piotrpawlowski
piotrpawlowski

Reputation: 786

Firebase Cloud Messaging: Invalid APNs certificates

I am not able to send push message to iOS device from FCM console. I receive error message "Check APNs certificates in settings". My configuration is the same as in FCM guide:

  1. I generated Auth Key in Apple Developer Account.
  2. I uploaded auth key in Firebase project, put Key Id and prefix (Team Id).
  3. I added FCM SDK to my iOS project (added Google-service.plist as well).
  4. I saved registration token in Firebase Database.
  5. Finally, I can send a message to all devices with my App ID (but cannot receive this message, I do not know why), but I cannot send a message to selected device with token.

Any ideas?

Upvotes: 6

Views: 14008

Answers (2)

Fuat
Fuat

Reputation: 809

  • Please check the app name in GoogleServices-Info.plist and Bundle ID in your app.
  • And also check you put the plist file in proper directory.
  • Uploaded auth key in Firebase project to both Dev and Prod ones.

This are the only reason for not having the push notfications to your app.

Upvotes: 2

Shooky
Shooky

Reputation: 1299

If the bundle ID that was used to generate the FCM token does not match the bundle ID in your Firebase App you will receive the error code: 'messaging/invalid-apns-credentials' even if your Auth key is configured correctly.

This seems like the most likely cause of this error ever occurring. Double and triple check that the FCM token was created by an app with the exact same bundle ID as what is listed in your Firebase console.

The GoogleServices-Info.plist does not verify that it contains the same Bundle ID as the app it is attached to so it is easy to make this mistake.

On the Android side you will get a compilation error if the appId is not present in your google-services.json thus preventing this issue.

Upvotes: 2

Related Questions