0
votes

I have configured a Firebase project for an iOS app. I have added seperate development and production APN certs in the Cloud Messaging settings. I'm able to successfully receive notifications I send from the Firebase Notifications console for a debug version of my app. However I'm unable to receive any notifications in the production version. I have disabled swizzling by setting the FirebaseAppDelegateProxyEnabled to NO in the info.plist. I also use the setAPNSToken to set the token type to prod in the didRegisterForRemoteNotificationsWithDeviceToken method. The app is signed using a production distribution profile and therefore uses the production APN environment. I can verify the production APN certificates etc. are valid as my app successfully receives notifications sent directly by the Apple APN gateway, gateway.push.apple.com:2195 using a Php script. I suspect that either;

  1. Firebase is using the development APN certificate. However to eliminate this I uploaded the production APN certificate as both the dev and prod certs in Cloud Messaging settings. This did not resolve the issue.

  2. Firebase is still swizzling and incorrectly identifying the app as a dev version and thereby setting the device token to sandbox. This is overriding my code to set the token type to prod. I have no way of verifying this to confirm.

Any assistance is much appreciated. Cheers

1
While I understand the question, this really isn't the right forum to ask about server, configuration or networking-related infrastructure. I would suggest the Firebase google group or reaching our directly to support@firebase. Also, you may want to review some info about stack overflow, How do I ask a good question? and this excellent read How to create a Minimal, Complete, and Verifiable example. - Jay

1 Answers

0
votes

The issue is due to the subscription failing with

Cannot subscribe to topic: /topics/XXX with token: (null)

As mentioned in the documentation the subscription is initiated in the

application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings)

method. However this method at times is executed before the async Firebase initialisation is complete. It is consistently noticeable when the app is newly installed and launched for the first time. This is as mentioned in the following thread.

Cannot receive push notification on iOS from Firebase 3.2.0 topics