iOS 10 UNUserNotificationCenterDelegate wird nicht aufgerufen. Push-Benachrichtigungen funktionieren nicht

Riss mir die Haare aus, um Push-Benachrichtigungen für iOS10 zu erhalten. Aktuelles Setup:

imfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool:

if #available(iOS 10.0, *) {

            let center = UNUserNotificationCenter.current()
            center.delegate = self
            center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in

                if error == nil {
                    print("DID REQUEST THE NOTIFICATION")
                    UIApplication.shared.registerForRemoteNotifications()
                }
            }
            print("DID SET DELEGATE")
        }

Imfunc application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data):

print("DID REGISTER FOR A REMOTE NOTIFICATION AND THE TOKEN IS \(deviceToken.base64EncodedString())"           
let request = UpdatePushNotificationSubscription_Request(deviceToken: deviceToken)
updatePushNotificationSubscriptionWorker.updateSubscription(request)

Ich habe überprüft, ob das Token korrekt in das Backend hochgeladen wurde und es stimmt tatsächlich überein.

Ich habe auch implementiert:

    @available(iOS 10.0, *)
    func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notificat,ion: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {

        print("GOT A NOTIFICATION")

    }


    @available(iOS 10.0, *)
    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {

        //This is for the user tapping on the notification
        print("GOT A NOTIFICATION")
    }

Ich habe die Berechtigungen für alle Ziele festgelegt und Push aktiviert:

Jetzt, wenn ich versuche, eine Nachricht vom Backend zu senden, empfängt das Gerät nichts. Delegierte werden nicht angerufen. Habe keine Ahnung was ich hier falsch mache. Push funktioniert für iOS9 und Android-Geräte. Gibt es Hinweise darauf, was ich möglicherweise falsch mache?

Antworten auf die Frage(8)

Ihre Antwort auf die Frage