24
votes

I'm using Google Firebase Cloud Messaging API (FCM) to send push notifications to my iOS app. I could get push-notifications working successfully when I test the app on a device with Development provisioning profiles + development push notification(sandbox) certificates.

However I'm unable to get it working on production environment. I made an ad-hoc build with correct production provisioning profiles and production push notification certificates. And synced an IPA file to a device via iTunes for testing (not directly from xcode). Still I can't receive push notifications from firebase console.

I have uploaded correct development and production certificates (with private keys) to firebase as well. I've double checked every possible step that could go wrong but, still can't find the issue. Is there a way to troubleshoot this issue? Or isn't it possible to get production environment notifications to an AdHoc build?

4
please explain why downvoted?Rukshan
Did you send your device token to Firebase?iSashok
I mean did you call this method [[FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeProd];?iSashok
I have not set FirebaseAppDelegateProxyEnabled to NO to call that method. But I tried this method as well. It didn't work.Rukshan
I did even better! I tested with an external build from testflight ;)Tiago Almeida

4 Answers

20
votes

I had the same issue. Apparently there is an error in the Firebase documentation. When you exporting the APN certificate for production from your keychain to the .p12 file you have to select the actual certificate, not the private key.

Make sure you upload to the Firebase console this .p12 file in the Cloud Messaging APN certificate settings.

1
votes

Had same issue. Finally got it working by:

  1. Using the correct Project and Target Build Settings as mentioned in This link.

  2. And revoking the existing push certificates and creating a new one completely, and then uploading the new certificate's .p12 file to the Firebase Console.

0
votes

What fixed my issue was using the new Authentication Keys method instead of the old p12 files. You can read more in the Firebase documentation, just follow their steps and you should be fine.

0
votes

I had the same issue.

What helped me: adding APNS for Distribution Certificate to Firebase. Simple as that ;)