6

I'm trying to configure my iOS app to receiver notifications with Firebase.

If I export the certificate and the private key without a password and try to upload it (production or development) on Firebase console I get the error "Incorrect password".

If I export the certificate and the private key with a password I get the error "An unknown server error ocurred" or "There was an error reading your certificate".

I don't understand why that is happening. I did follow the tutorial correctly. Can someone help me?

Breno Macena
  • 449
  • 8
  • 19

3 Answers3

7

You should be using an APNS Authentication Key rather than the certificates. This is the new preferred method in iOS for a provider to register and send messages with APNS

From Firebase:

Configuration with auth keys is recommended as they are the more current method for sending notifications to iOS

From Apple:

For a provider to communicate with APNs, it must employ a valid authentication key certificate (for token-based connection trust) or SSL certificate (for certificate-based connection trust). You obtain either of these certificates from your online developer account, as explained in “Configure push notifications” in Xcode Help. To choose between the two certificate types, read Provider-to-APNs Connection Trust. Whichever certificate type you choose, provider connection trust is prerequisite to a provider sending push notification requests to APNs.

Chris
  • 7,830
  • 6
  • 38
  • 72
1

while exporting just select the Apple Push Service part and don't select the private key from Keychain Access and export than in firebase Production APNs certificate browse the p12 file you just created, it will work.

I don't know when this implementation will be deprecated but it works as of now (19 Feb 2018).

Anirudha Mahale
  • 2,526
  • 3
  • 37
  • 57
1

You should export only the certificate and don't select the private key . Please see this screenshot

enter image description here

Sreeraj VR
  • 1,524
  • 19
  • 35