Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InvalidApnsCredential while certificates are valid

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?

like image 783
SeikoTheWiz Avatar asked Apr 20 '17 09:04

SeikoTheWiz


4 Answers

In case if others are also facing the issue here are few tips:

  1. Whenever you are stuck with notification issues try sending a push via the GUI console that firebase provide to send notifications

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

  3. 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

like image 126
harshal jadhav Avatar answered Nov 19 '22 12:11

harshal jadhav


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

like image 28
Abhijith Avatar answered Nov 19 '22 11:11

Abhijith


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.

like image 2
Matthew Fala Avatar answered Nov 19 '22 11:11

Matthew Fala


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

like image 1
Madhav Deva Avatar answered Nov 19 '22 13:11

Madhav Deva