How to Generate pem file to setup Apple PUSH Notification

To enable Push Notification for your iOS app, you will need to create and upload the Apple Push Notification Certificate (.pem file) to us so we will be able to connect to Apple Push Server on your behalf.

Follow these steps:

  • Login to apple developer account, click “Certificates” on the left navigation bar. Then, click “+” button.Certificate
  • Select Apple Push Notification service SSL (Production) option under Distribution section, then click “Continue” button.APNS Certificate
  • Select the App ID you want to use, then click “Continue” to go to next step.APP ID Screen
  • Follow the steps “About Creating a Certificate Signing Request (CSR)” to create a Certificate Signing Request.Create CSR File
  • Navigate to Certificate Assistant of Keychain Access on your Mac.Keychain Image
  • Fill in the user Email Address, Common Name and Save to disk and click continue.Keychain
  • Upload the “.certSigningRequest” file which is generated, then click “Generate” button.Generate Certificate
  • Click “Done” to finish the registration.

Then Click “Download” button to download the certificate (.cer file) you’ve created just now.

Double click the downloaded file to install the certificate into Keychain Access on your Mac.

On your Mac, go to “Keychain”, look for the certificate you have just installed. If unsure which certificate is the correct one, it should start with “Apple Production IOS Push Services:” followed by your app’s bundle ID.

Expand the certificate, you should see the private key with either your name or your company name. Select both items by using the “Select” key on your keyboard, right click (or cmd-click if you use a single button mouse), choose “Export 2 items”.

Export P12

Then save the p12 file with name “pushcert.p12” to your Desktop. Now you will be prompted to enter a password to protect it, you can either click Enter to skip the password or enter a password you desire.

Now the most difficult part – open “Terminal” on your Mac, and run the following commands:

cd
cd Desktop
openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts

We successfully generated .pem file, If you find any difficulties generating .pem please do comment and we will be happy to help.

That’s It. If you like this post, Please comment below and subscribe this blog.

Leave your comments

Advertisements