# iOS Push Notification Certificate Setup

To send or receive push notifications for iOS devices using our SDK, you can either

* Create push notification certificate (.p12 certificate) from the Apple Developer Console OR
* Create a push notification Key (.p8 certificate) from Apple Developer Console

and upload to our social.plus console.

<figure><img src="/files/RNWyEeOU1AF9Ja3c9Bk6" alt=""><figcaption></figcaption></figure>

We recommend creating Apple Push Notification Key as it is more versatile. You can follow the steps outlined here to generate the APNS key (with .p8 file extension)\
<https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns>\\

If you do not support Apple Push Notification Key and want to use certificate based authentication for push notification (i.e .p12 file), here are the steps to generate a push notification certificate from the Apple Developer Console.

{% hint style="info" %}
When a new .p12 certificate is created, the previous certificate gets revoked and cannot be used again.
{% endhint %}

**Step 1:**

Go to Apple Developer Console (i.e. [https://developer.apple.com](https://developer.apple.com/)) and click on Certificates.

<figure><img src="/files/CojQJl4kCzcCzkLeoiTS" alt=""><figcaption></figcaption></figure>

**Step 2:**

Select Apple Push Notification Service SSL (Sandbox & Production)

<figure><img src="/files/9rGkBfFJIiZCwoITfUdI" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This certificate will be applicable for both Sandbox & Production environments so you do not need to create a separate one for each one.
{% endhint %}

**Step 3:**

Follow the rest of the steps of creating certificates as shown by Apple & download the **.cer** file.

**Step 4:**

Double-click on the **.cer** file you downloaded in the last step in Finder. After a few seconds, the Keychain Access program should open.

**Step 5:**

Select **Login → My Certificates**, then right-click on the Apple Push Services certificate that you just installed. It would show you some options as shown below.

<figure><img src="/files/JvtlaO5VIfqSgFLgzqrN" alt=""><figcaption></figcaption></figure>

**Step 6:**

Select the **Export “Apple Push Services …”** option and save the file using the .p12 extension. If you add a password while exporting, you will need to enter the same password in the social.plus Console.

**Step 7:**

Open social.plus Console. Select **Settings → Push Notifications** & Upload this .p12 file to social.plus Console.

<figure><img src="/files/YKbsg4iPjMJcz9uVlRbp" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This certificate can be used to receive push notifications in your production build (Distributed through Appstore or Testflight). Currently, we do not support receiving push notifications in the Debug build.
{% endhint %}

That’s it. Now the certificate is setup, Please follow the steps shown in the [Register & Unregister Push Notifications](/social-plus-sdk/core-concepts/push-notifications/register-and-unregister-push-notifications-on-a-device.md) section to correctly send APNS tokens to receive push notifications.

{% hint style="info" %}
Please make sure you have **Push Notification** capabilities enabled in your Xcode Project.
{% endhint %}


---

# 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.social.plus/social-plus-sdk/core-concepts/push-notifications/ios-push-notification-certificate-setup.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.
