I'm trying to send a message to my push notification test app. It's been working in proof of concept several weeks ago on the same application but not anymore.
I get a failure: InvalidApnsCredential and Firebase tell us : "A message targeted to an iOS device could not be sent because the required APNs SSL certificate was not uploaded or has expired. Check the validity of your development and production certificates"
But when I check in my firebase console, it tells me that dev and prod certificate will be valid for 9 more months.
What else could be causing this message?
In case if others are also facing the issue here are few tips:
Whenever you are stuck with notification issues try sending a push via the GUI console that firebase provide to send notifications
If your live app at Appstore is not receiving push notification but is receiving notification only when running via Xcode then you have not uploaded the production certificate to the firebase console
If you have uploaded both production and development certificates and still notifications are not received then download the latest certificates and upload them again to the firebase console
Adding Team id in Firebase worked for me.
Firebase console -> General -> select your app -> Add TEAM ID
You can find team ID in Apple developer portal :
https://developer.apple.com/account/#/membership
This might pain you to hear, but it seems that the Firebase Cloud Messaging system doesn't like dashes in the bundleID. I had something alongs of my.app.bundle-y and I was receiving InvalidAPNSCredential message on postman... I eventually tried changing my bundle id to my.app.bundle when all else failed, and notifications started coming through.
This is pretty severe change, and only really reasonable if the app is not yet deployed.
If all else fails and you have a dash in your bundle id, then maybe give this a go.
In the case of uploading a .p8 file (APNs auth key), adding proper Key ID worked for me.
When you download the .p8 file from Apple. The filename will be in format AuthKey_XXXXXXXXXX.p8. The 10 digit(marked XXXXXXXXXX after the AuthKey_) is the Key ID you need to add.please refer to the image
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With