Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase: Cannot upload production APNs certificate

I am currently testing an app in TestFlight and need a production APNs certificate in order to test Notifications in Firebase.

I have followed all of the steps in this video and successfully configured the development APNs certificate: https://www.youtube.com/watch?v=LBw5tuTvKd4

I've also checked that my steps following the Firebase support guide. Although I note that the Apple Developer site has changed slightly since this guide was written: https://firebase.google.com/docs/cloud-messaging/ios/certs#configure_an_app_id_for_push_notifications

I have generated a production APNs certificate at developer.apple.com using the same method as the development certificate but when I try to upload the .p12 file to Firebase, it gives me the following error:

"The certificate environment did not match. Ensure that you got the right development or production APNS certificate."

I'm definitely uploading a .p12 generated from a production APNS certificate, is there something else I need to do for a production certificate?

like image 504
Robbie Lewis Avatar asked Jun 13 '16 09:06

Robbie Lewis


2 Answers

Solved. The mistake I was making was that I was exporting the "private key" part of the certificate in Keychain Access instead of the "certificate" part. As soon as I re exported the .p12 using the correct row in the list - it worked.

Images to illustrate below credit iOS

Don't select & create private key for Production certificate

Correct method:

Directly select certificate & create production certificate

like image 119
Robbie Lewis Avatar answered Oct 09 '22 02:10

Robbie Lewis


try this

make .csr file and download cert from developer.apple.com

while exporting select private key and certificate both at a same time and export to .p12 with any passphase.

upload tht .p12 file on firebase console.

Thanks

like image 11
vaibby Avatar answered Oct 09 '22 01:10

vaibby