iOS Push Notification

In below steps, you will learn how to create .pem file for Push Notification.

Enabling the Push Notification Service

The first step is to change the App ID. Go to App Settings -> General and change Bundle Identifier to something unique:

Next, you need to create an App ID in your developer account that has the push notification entitlement enabled. Luckily, Xcode has a simple way to do this. Go to App Settings -> Capabilities and flip the switch for Push Notifications to On.

After some loading, it should look like this:

Now you have create .pem file for Push Notification, steps are below.

First of all login into your developers account credentials https://developer.apple.com/account/

You will be redirected to following screen, Click on “Certificates, Identifiers and Profiles”.

Step 1: Click “+” button of certificates

Step 2: Select Apple Push Notification service SSL (Sandbox & Production) and click “Continue”

Step 3: Now, Select the app ID drop Drop down list and click on “Continue” to go to the next step.

Step 4: Follow the steps under “About Creating a Certificate Signing Request (CSR)” for Creating Certificate Signing Request

In addition to the instructions provided by Apple, Here are some additional screenshots to guide you creating required certificate.

Step 4.1: Select “Request a Certificate From a Certificate Authority” by navigating “Certificate Assistance” from toolbar options for keychain.

Step 4.2: Fill the required certificate Info. — select “Saved to disk” and select “Continue”

Step 5: Upload “.certSigningRequest” file which was generated (in Step 4), then click “Generate”.

Step 6: Now Click “Done” to finish the registration,the page will be refreshed and you will see this screen

Then Click “Download” button to download the certificate (.cer file) you’ve created just now and then double click the downloaded file to install the certificate into Keychain Access on your Mac.

Step 7: Now go to “Keychain” on you mac system, look for the certificate you have just installed. If you are unsure which certificate is the correct , it should start with “Apple Production IOS Push Services”and followed by app’s bundleID.

Step 8: 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”, like Below:

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.

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

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

Step 10: Remove pushcert.p12 from Desktop to avoid mis-uploading it to Build Your Own area. Open “Terminal” on your Mac, and run the following commands:

  1. cd
  2. cd Desktop
  3. rm pushcert.p12

Okay then, we are done with this tutorial.

we successfully generated .pem file.

If you find any difficulties generating .pem please do comment and we will be happy to help.