Firebase Cloud Messaging: Invalid APNs certificates
Asked Answered
C

2

6

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?

Creath answered 20/7, 2018 at 13:31 Comment(5)
Check to make sure the App ID Prefix listed in the Firebase app matches that of the iOS appApostles
I have checked and it matches. The app Id prefix matches apple team IDCreath
Can you confirm that push notifications are enabled in Capabilities in the Xcode app?Apostles
Sure. I receive "InvalidApnsCredential" error from FCM server.Creath
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)Useful
B
2

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.

Bremer answered 24/7, 2018 at 20:46 Comment(0)
R
2
  • 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.

Redraft answered 16/3, 2019 at 13:16 Comment(1)
This was the answer for me; thanks. We had multiple apps configured in firebase, and I was assigning the apple APN key to the wrong one.Psalterium

© 2022 - 2024 — McMap. All rights reserved.