SwiftUI AppDelegate didRegisterForRemoteNotificationsWithDeviceToken never called

Simple problem that breaks the world:

SwiftUI, assigned the @UIApplicationDelegateAdaptor, but the only delegate method that ever gets called is didFinishLaunchingWithOptions. I need the push notification token from the didRegisterForRemoteNotificationsWithDeviceToken delegate method.

How do I get this? I've tried switching back to old lifecycle by using:

let window = UIWindow()
self.window = window
window.rootViewController = UIHostingController(rootView: ContentView().environmentObject(SessionStore()))

But this creates problems with @Observed objects in the app and crashes on people's devices.

Dear Apple: THIS IS A NIGHTMARE!! Please help... someone... anyone...

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum