4
votes

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?

2
Check to make sure the App ID Prefix listed in the Firebase app matches that of the iOS app - Jen Person
I have checked and it matches. The app Id prefix matches apple team ID - piotrpawlowski
Can you confirm that push notifications are enabled in Capabilities in the Xcode app? - Jen Person
Sure. I receive "InvalidApnsCredential" error from FCM server. - piotrpawlowski
I got the same problem, especially when using different TeamIDs. All setup were correct (p8 Key, TeamID, KeyID). The solution for me was to generate a new server legacy key (Firebase -> Cloud Messaging -> First option) - user8675

2 Answers

2
votes

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.

2
votes
  • 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.