# My APNS push certificate expired, what should I do?

Batch servers need a push certificate to communicate with Apple Push Notification Services (APNs). There are two kinds of certificates you can use with Batch: a .p8 file or a .p12 certificate, which expires after 12 months.

If you stop receiving push notifications and an error message appears in the campaigns list, your .p12 certificate probably expired.

Here is how to generate a .p8 file for your app in two easy steps:

## 1. Download the .p8 file <a href="#id-1-download-the-p8-file" id="id-1-download-the-p8-file"></a>

First, generate and download a new .p8 file:

* Go to the [Apple Developer Member Center](https://developer.apple.com/account/ios/profile/profileList.action)
* Go to the *"Keys"* menu
* Add a new key.

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

* Give a name to your key
* Tick the *"Apple Push Notifications Service"* box
* Download the .p8 file.

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

## 2. Upload the .p8 file <a href="#id-2-upload-the-p8-file" id="id-2-upload-the-p8-file"></a>

On the Batch dashboard, go to **Settings → Channels → iOS**, and upload your .p8 file.

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

You will need to paste two IDs to be able to use your new certificate:

* **App ID / Bundle ID**: Use the bundle ID you will find in Xcode. You can also use the app ID available from the Developer Console [here](https://developer.apple.com/account/ios/identifier/bundle).
* **Team ID**: The team ID is available from the Developer Console [here](https://developer.apple.com/account/#/membership/).

{% hint style="warning" %}
Make sure you use the correct IDs.\
After uploading the new certificate, we recommend sending a push to your device.
{% 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://doc.batch.com/developer/troubleshooting/my-apns-push-certificate-expired-what-should-i-do.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.
