> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# APNS Certificate/PEM file (legacy)

<Note>
  **Note**

  Effective January 15, 2026, MoEngage will deprecate the legacy APNs Provider Certificate (.pem) method. After this date, existing certificates cannot be renewed, and all new uploads must use the [APNs Authentication Key (.p8)](/developer-guide/ios-sdk/push/basic/apns-authentication-key).

  MoEngage strongly recommends migrating to the .p8 Auth Key as soon as possible to ensure uninterrupted service. This upgrade offers the following benefits:

  * **Permanent validity**: Auth Keys never expire, eliminating the need for annual certificate renewals.
  * **Faster delivery**: Stateless token-based authentication provides faster communication than certificate-based methods.
  * **Modern feature support:** The new standard supports exclusive iOS capabilities, such as Live Activities.
</Note>

In order to send push notifications to your app, an APNS certificate is needed for your app, and the same has to be converted to a `.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:

<img src="https://mintcdn.com/moengage-sdk-docs/zOPuW3yHiLk5p-EH/images/apnspem1.png?fit=max&auto=format&n=zOPuW3yHiLk5p-EH&q=85&s=17364018d17db16430b4bb27c6d67dd6" alt="Apnspem1" title="Apnspem1" style={{ width:"83%" }} width="1598" height="724" data-path="images/apnspem1.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”:

<Frame>
  <img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/pemfile2.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=cbf5bb6fc28129e1b3eeb4e2ff347f53" alt="Pemfile2" title="Pemfile2" style={{ width:"81%" }} width="1456" height="1096" data-path="images/pemfile2.png" />
</Frame>

## Create 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:

<img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/pemfile3.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=43cfe6b4e632bb9dd79190a3f8a08c71" alt="Pemfile3" width="2652" height="736" data-path="images/pemfile3.png" />

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

<img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/pemfile4.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=45e5a9b8436387f4cc2a987ee9f08c3d" alt="Pemfile4" width="2648" height="978" data-path="images/pemfile4.png" />

<Warning>
  **APP ID Selection Note**

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

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

<img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/penfile5.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=218f9b06cc8b6ad7ebbf2c07d521da04" alt="Penfile5" width="2760" height="992" data-path="images/penfile5.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`

<img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/pemfile6.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=242dd8ec29e49a01127aec1ac028b36b" alt="Pemfile6" width="2736" height="892" data-path="images/pemfile6.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`:

   <CodeGroup>
     ```ruby Ruby wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
     openssl pkcs12 -in p12Cert.p12 -out pemAPNSCert.pem -nodes -legacy
     Enter Import Password:
     MAC verified OK
     ```
   </CodeGroup>

<Info>
  **Note**

  You can also go the SSL Converter [here](https://www.sslshopper.com/ssl-converter.html) and convert your `.p12` file to `.pem`.
</Info>

# 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`)

   <CodeGroup>
     ```text Text theme={"theme":{"light":"github-light","dark":"github-dark"}}
     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-----
     ```
   </CodeGroup>
2. Also, you check the validity of the certificate by going to SSLShopper [Certificate Decoder](https://www.sslshopper.com/certificate-decoder.html) and pasting the Certificate Content (from `BEGIN CERTIFICATE` to `END CERTIFICATE`) to get all the info about the certificate as shown below:

   <Frame>
     <img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/pemfile7.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=f2287dec713fc1dfd74f2aecfa06aa1d" alt="Pemfile7" width="1532" height="468" data-path="images/pemfile7.png" />
   </Frame>

   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

1. Navigate to **Settings > Channels > Push > App Push**.
2. Select iOS (APNS) in the Platforms available on the menu at the top.
3. Click on **APNS provider certificate**.
4. Upload the *.pem* file. Enter the password for the *.pem* file, or leave it blank if there isn't any.

   <Frame>
     <img src="https://mintcdn.com/moengage-sdk-docs/JWiTYHgM3sZmk2vD/images/pemfile8.png?fit=max&auto=format&n=JWiTYHgM3sZmk2vD&q=85&s=a749ab01a88a7f07e37c353502842e89" alt="Pemfile8" width="1858" height="1452" data-path="images/pemfile8.png" />
   </Frame>

<Info>
  **iPad Support**

  In case you have different apps for iPhones and iPads(Different Bundle IDs), set up certificates for both iOS and iPad separately in the dashboard in order to be able to send the messages to all the devices.
</Info>

# Test/Live Builds

* If you are testing the app on **Test Flight or a live app store build**, make sure you upload the ad-hoc or production pem to our dashboard. And also in this case you have to send push notifications from the **Live environment** of your account.
* For the dev build, you can upload the development or production certificate in the dashboard, but make sure that you create your campaign in the **Test environment**, as you cannot send push notifications to the dev build from the Live environment.
