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
What if we're using P8 file, an auth key, and still got this error
InvalidApnsCredential
?Number two fixed my annoying problem! Again man Thanks! I should have noticed the difference between the "development" and "production" certificate
great ... it made my day... just resolved it using #2.. Thanks alot!!
We have the same issue with our P8 auth key. The whole error message is
{ "error": { "code": 401, "message": "Invalid APNS credential", "status": "UNAUTHENTICATED", "details": [ { "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError", "errorCode": "APNS_AUTH_ERROR" }, { "@type": "type.googleapis.com/google.firebase.fcm.v1.ApnsError", "statusCode": 403, "reason": "InvalidProviderToken" } ] } }
@boog, make sure your bundle id doesn't have any typos. In my case, I had one camel-cased and the other lowercase.