How to generate valid APNS Certificate (.p12) for use in GCM for iOS?
Asked Answered
C

4

24

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

Countrydance answered 2/6, 2015 at 17:6 Comment(0)
N
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

Nasho answered 23/6, 2015 at 17:52 Comment(6)
The key point is to select both the certificate and the key before exporting to .p12. That was enough in my case at least.Licensee
If you say so, i was't familiar with IOs Development.Nasho
@Nasho 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! ThanksZealand
I've done all that step by step and get "There was an unknown error while processing the request. Try again."Haldane
Could you post a link to the Google Admin page where you can upload the certificate (last greenish screenshot)? I cannot seem to find it.Mystic
In my case, just exporting the certificate (parent of private key) worked. Exporting both certificate and private key did not work.Weaver
C
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.

Courtesan answered 28/5, 2016 at 14:35 Comment(0)
T
2

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

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

Thickknee answered 16/11, 2015 at 9:46 Comment(0)
C
1

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

Countrydance answered 2/6, 2015 at 19:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.