1
votes

I am receiving the token, but when I send a notification from the Firebase Console, nothing happens on my device, no matter if the app is backgrounded or not. At the same time, my Android app receives the notification.

I followed this guide:

https://firebase.google.com/docs/cloud-messaging/ios/client

and just to be sure, I also copy-pasted the sample code at

https://github.com/firebase/quickstart-ios/blob/master/messaging/MessagingExampleSwift/AppDelegate.swift

Testing this function:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    print("----- Successfully registered for notifications!")
}

works, and the didFailToRegisterForRemoteNotificationsWithError function does not get called.

What can I do now?

1

1 Answers

1
votes

It turned out, only messages that do not contain a notification object are delivered if your app hasn't yet been approved to the App Store.

After having the first version out, push notifications work for your app, even in debug mode.