APNS Certificate/ PEM file

In order to send push notifications to your app, APNS certificate has to be created for your app and the same has to be converted to .pem format and uploaded to our dashboard. Follow the steps below to do the same:

Creating APNS Certificate

Generating the Certificate Signing Request (CSR)

First Open Keychain Access on your Mac and choose the menu option Request a Certificate from a Certificate Authority as shown below:

138254b-Screenshot_2020-01-12_at_14.11.18.png

You should now see the window shown below. Enter your email address here and your app name for Common Name. Check Saved to disk and click Continue. Save the file as “.certSigningRequest”:

6a050fd-Screenshot_2020-01-12_at_14.14.44.pngCreate an APNS Certificate in Developer Account

Log-in to your developer account and go to Certificates, Identifiers and Profiles. Select Certificates Section and Click on the + icon to create a new certificate. In Create a New Certificate screen select Apple Push Notification service SSL(Sandbox & Production) and click Continue as shown below:

3cc77af-Screenshot_2020-01-12_at_14.18.40.png

Next, select the App ID(App Bundle ID) for which you are creating the APNS certificate and click Continue

dc9df04-Screenshot_2020-01-12_at_14.18.52.png

 

APP ID Selection Note

Ensure Push Notification capability is enabled for the App(App ID selected) you are creating an APNS certificate for.

Now choose the certificate signing request file created in the first step and click Continue as shown below:

eebd391-Screenshot_2020-01-12_at_14.19.39.png

That's it! your APNS certificate has been successfully created. Go ahead and download the same and open it to include it in your Mac Keychain Access

e87c36b-Screenshot_2020-01-12_at_14.20.37.png

Converting Certificate to PEM format

Follow the below steps to convert the APNS certificate obtained in the previous step to .pem file:

  1. First, go to Keychain Access and select your APNS certificate, then right-click on it select Export option. Now export your certificate in .p12 format. You will be prompted to provide a password for .p12, do the same.

  2. Convert the .p12 file obtained in the previous step into a .pem file by using openssl commands as shown below, here you will have to provide the Import Password:

Ruby
$ openssl pkcs12 -in p12Cert.p12 -out pemAPNSCert.pem -nodes
Enter Import Password:
MAC verified OK
 

NOTE

You can also go the SSL Converter here and convert your .p12 file to .pem.

Verify .pem file

Before uploading the certificate to MoEngage Dashboard, verify the .pem file obtained:

  1. First, open the .pem in a text editor to view its content. The certificate content should be in format as shown below. Make sure the pem file contains both Certificate content(from BEGIN CERTIFICATE to END CERTIFICATE) as well as Certificate Private Key (from BEGIN PRIVATE KEY to END PRIVATE KEY) :
Text
Bag Attributes
    friendlyName: Apple Push Services:<Bundle ID>
    localKeyID: <>
subject=<>
-----BEGIN CERTIFICATE-----

<Certificate Content>

-----END CERTIFICATE-----
Bag Attributes
    friendlyName: <>
    localKeyID: <>
Key Attributes: <No Attributes>
-----BEGIN PRIVATE KEY-----

<Certificate Private Key>

-----END PRIVATE KEY-----
  1. Also, you check the validity of the certificate by going to SSLShopper Certificate Decoder and paste the Certificate Content (from BEGIN CERTIFICATE to END CERTIFICATE) to get all the info about the certificate as shown below:9449df7-Screenshot_2020-01-12_at_15.58.10.png

As you can see the Common Name should contain Apple Push Services and the App's Bundle ID. Confirm the organization's information and also the Validity of the Certificate. Once everything is verified, upload the certificate to our dashboard.

Uploading PEM file to MoEngage Dashboard

Open the settings page in the MoEngage Dashboard, go to Settings > Push > Mobile Push > iOS. and upload the .pem file. Enter the password if set for the .pem file OR leave it blank.

 

TABLET SUPPORT

Make sure to setup certificates for both iOS and iPad if you plan on sending messages to those devices. Messages will not be sent to iPad if only iOS certificate is setup.

e7a046c-Screenshot_2020-01-12_at_16.27.47.png

Was this article helpful?
0 out of 0 found this helpful