23

I am trying Google Cloud Messaging sample app for iOS platform. https://developers.google.com/cloud-messaging/ios/start

To generate GoogleServices-Info.plist APNS development and production certificates are needed (PKCS#12 file format). I have created .p12 file in MAC KeyChain Access (bundling both APNS dev certificate and private key).

But when uploading the .p12 file, it says it is not in valid format (The certificate must be a valid PKCS12 file).

4 Answers 4

55

Here's my solution, without the terminal !

  • delete your actual certificate ( in Keychain ) : "Apple Development IOS Push Service" & "Apple Production IOS Push Service"

  • Go to Apple Developer, Identifiers, App IDs, Select "YourApp", Edit, Push Notification and download the 2 certificates (dev & prod)

enter image description here

enter image description here

  • import these 2 certificates in Keychain

  • in Keychain, go to "My Certificates", find the "Apple Development IOS Push Service" & "Apple Production IOS Push Service", click on the arrow to expand the Certificate + Key

  • Select both the the Certificate + Key, Right click "Export 2 items", you have your .p12 valid certificate ready for upload to GCM Services

enter image description here

enter image description here

This link helped me : http://faq.appaloosa-store.com/knowledgebase/articles/61785-how-to-generate-push-notification-p12-file

7
  • 3
    The key point is to select both the certificate and the key before exporting to .p12. That was enough in my case at least.
    – PakitoV
    Sep 29, 2015 at 9:28
  • If you say so, i was't familiar with IOs Development.
    – dam1
    Sep 29, 2015 at 13:57
  • @dam1 I'm very glad your steps worked, as I didn't have to do any of the OpenSSL steps in code.google.com/archive/p/apns-sharp/wikis/… so am very pleased! Thanks Jan 29, 2016 at 17:59
  • Thanks for my time saving!! Oct 1, 2016 at 12:59
  • I've done all that step by step and get "There was an unknown error while processing the request. Try again." Jan 18, 2017 at 10:23
4

For anyone still having this issue, the solution for me was to not select both the key and the certificate for export - rather just export the certificate which ALREADY includes the key.

2

you can select only one also to export in .p12 format..

macApplication > Keychain Access > My Certificates > Export in .p12 format

1

This problem comes when we use Firefox to upload the .p12 file. In Chrome I am able to upload the same file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.