# Prerequisites

### Creating an app

*Let's get going!*

The very first step is to go to [Batch's dashboard](https://dashboard.batch.com/) and create a new iOS app.

![Registering a new app](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F2M99Uu7clJeVP8yDmjJy%2Fdashboard_new_app_screenshot.png?alt=media\&token=5f1c4b1f-38f7-43f2-b151-7f828dd0b49c)

### Configuring notifications

Once your app is created, you will need to download a .p8 file and upload it to Batch's Dashboard.

As a reminder, Batch servers need to have a valid certificate in order to communicate with Apple Push Notification Services *(APNS)*. There are two types of files you can use:

* **.p8 files (recommended)** : Valid for all the apps added to your Apple developer account. You will need to specify the Application Identifier *(App ID)* or the Bundle ID of your app on Batch's dashboard.
* **.p12 certificates**: Generated for a unique App ID and are only valid for one year. If you need a .p12 certificate, please follow these instructions: [Generating a .p12 certificate](https://doc.batch.com/developer/sdk/advanced/general#generating-the-.p12-certificate).

**Step 1. Downloading the .p8 file**

Head to the [Apple Developer Member center](https://developer.apple.com/account/resources/authkeys/list), then go to the *"Keys"* menu and add a new key.

![Adding a key](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F9SJrcCaHvbkmsutlDxmm%2Fprerequisites_p8_adding_key.png?alt=media\&token=fbe20a6f-0619-4c3f-9f70-e5bf85b7ea2a)

Give a name to your key, tick the *"Apple Push Notifications Service"* box (1) and press "Configure" (2).

![Configuring the key](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F5ysBIwiYNkzuJ2taSiD4%2Fprerequisites_p8_checkbox.png?alt=media\&token=8f393f7e-c050-4f6f-9229-d182ee241caf)

There, in the "Environment" dropdown, select "Sandbox & Production".

![Configuring the environment](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FeswzqWo0sK25DUpspKm8%2Fprerequisites_p8_environment.png?alt=media\&token=86254b24-192a-4942-86aa-579aafa29444)

Click "Save" and continue until you can download the P8 key. Write down your Key ID.

**Step 2. Uploading the .p8 file**

Now go to Batch's dashboard → ⚙ Settings → Push settings, and upload your .p8 file.

![Uploading your certificate](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F0n4C8TlDzbYizjZsRmUg%2Fprerequisites_p8_upload.png?alt=media\&token=697e46b4-8e2e-468c-b294-b0a76f8f506c)

There are two IDs you need to find to save your certificate and send notifications to your app:

* **App ID / Bundle ID**: We recommend you 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 also available from the Developer Console [here](https://developer.apple.com/account/#/membership/). It is also shown under your name in the top bar of the place you created your p8 key.
* **Key ID**: The Key ID should be automatically filled if you didn't rename the p8 file you downloaded from Apple. If it was not, use the Key ID you have written down earlier. You can also find the Key ID in the Apple Developer Member center, where you generated it.

### License Attribution

As Batch uses open-source software, you must include attribution text in your application. This usually goes in a "Legal Notices" or "About" screen.

You can get the attribution text [here](https://github.com/BatchLabs/Batch-iOS-SDK/blob/master/LICENSE.thirdparty).
