# Generate iOS Push Certificate (Legacy)

{% hint style="warning" %}
This page is no longer being updated. Please refer to our [Push Notifications - OneSignal](/guides/integration/push-notifications-onesignal.md) for current configurations and support.
{% endhint %}

## Prerequisities

* Created [Bundle Identifier](broken://pages/GO6Q68GbybIEr01M4coS#bundle-identifier) & [AppStore App Id](broken://pages/GO6Q68GbybIEr01M4coS#app-store-app-id)
* [Mac OS](#mac-os), [Windows, or Linux](#windows-and-linux)

## Mac OS

* Open a Keychain Access and select

![](/files/4x1v2qr2oPpZgLRmUejy)

* Enter your email, name, and select **Saved to disk.** Click **Continue.**

![](/files/ysKNz7Anbqx8mH2omqlR)

* After we've created the **Certificate Request** file:
  * Open the [Apple Developer homepage](https://developer.apple.com/account) and select [**Certificates, IDs & Profiles**](https://developer.apple.com/account/resources/certificates/list) \*\*\*\* (left menu)
  * Click on the [**Add button (+)**](https://developer.apple.com/account/resources/certificates/add)\*\*\*\*
  * Select **Apple Push Notification service SSL (Sandbox & Production)**
  * Click **Choose File** and select the **CertificateSigningRequest.certSigningRequest** file.
  * Click **Continue** & **Download**.

![](/files/1yQrI61aL0ZteiFHxRqb)

* Double click on the aps.cer file, and open a Keychain Access.
* Open **login -> Certificates** and select your certificate. (You can search it by your app bundle id)

![](/files/XutIn6sV7C8mPxm7rGSy)

* Right-click on it and click **Export "Apple Push Service: ..."**. \*\*\*\* After that \*\*\*\* select a place where you want to save an exported file.

![](/files/G4921fb3BwKkdNAmnXhQ)

* Enter a password (you will use it for OneSignal later) and click **OK.**

![](/files/chQGgKCxiv0wuuphEi12)

* That's it, we've generated our .p12 certificate that can be used for OneSignal Push Notifications.

## Windows & Linux

* Install [Keychain Explorer](https://keystore-explorer.org/downloads.html) tool.

![](/files/BWePzoxtA16BqYieK20m)

* Open KeyStore Explorer and click **Create a new KeyStore**.

![](/files/8vT31RcP8vpoqfuiHfnq)

* Select **PKCS #12** Type and click **OK.**

![](/files/tKgTSDeLYZDHvbGgcFyE)

* After KeyStore was created, right-click on empty space and select **Generate Key Pair.**

![](/files/vTSSWbqmMjtUp3kv0gbr)

* Make sure that all parameters match a screenshot one and click **OK**.

![](/files/xTpsK1i1J9KhwHecHqDs)

* Click **Contacts** button

![](/files/L3jiZC7flvvSJwJcD17P)

* We need 3 parameters (**Common Name,** **Email,** and **Country**). You can select them in the dropdown list and remove the rest through **(-)** button.

![](/files/VLuB7yOrtUkTDRUcy7xC)

* Enter all information. Make sure the **Country** parameter has a 2 symbols value (USA - **US**, Ukraine - **UA**, Germany - **GE**, etc.). You can find your country code [here](https://cheapsslsecurity.com/p/what-is-ssl-country-code-and-how-do-i-get-one-for-my-csr/).

![](/files/EkgvQ9U8OnxeNzbB0Xi6)

* Make sure that all parameters match a screenshot one and click **OK**. (Next two popups will be with name and password, you can click **OK** without editing on both of them).

![](/files/OeKOuJvYBUbN5nGgKLIE)

* Right-click on your new Key Pair and select **Generate CSR**

![](/files/Beome5Nz0szY5Sa3s5mU)

* Click **Browse.**

![](/files/0UHevbA70rcLfD4cQ54r)

* Select a directory where you want to save your file, enter a filename (*YOURFILENAME***.csr**) \*\*\*\* and click **Choose**

![](/files/6ck9Ui8sOLr89ADEPVcG)

* Make sure that all parameters match a screenshot one and click **OK**.

![](/files/YBoG5lgRqyvg8Q6s6Xsf)

* After we've created **CSR** file, open your [Apple Developer account:](https://developer.apple.com/account)
  * Open the [Apple Developer homepage](https://developer.apple.com/account) and select [**Certificates, IDs & Profiles**](https://developer.apple.com/account/resources/certificates/list) \*\*\*\* (left menu)
  * Click on the [**Add button (+)**](https://developer.apple.com/account/resources/certificates/add)\*\*\*\*
  * Select **Apple Push Notification service SSL (Sandbox & Production)**
  * Click **Choose File** and select the CSR file.
  * Click **Continue** & **Download**.

![](/files/1yQrI61aL0ZteiFHxRqb)

* Open Keychain Explorer, right-click on your Key Pair, and select **Import CA Reply -> From File.**

![](/files/oitGpNJ5psTzTsJbQ8Zw)

* Select downloaded earlier Apple's aps.cer and click **Import.**

![](/files/KZ9Gu5vFohG47bRlR5iI)

* Right-click on your previously imported Key Pair and click **Export -> Export Key Pair.**

![](/files/31T2icFidGE24VMTTpJu)

* Enter a password (you will use it for OneSignal later) and click **Export.**

![](/files/LFBdsqpLreNWvKtyfWLl)

* That's it, we generated our .p12 certificate that can be used for OneSignal Push Notifications.

![](/files/BjBBcYd4htPkyvSIA3IY)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.buildnatively.com/guides/generate-ios-push-certificate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
