Getting Keys for iOS Apps and Setting Up Connections to APNs

🚧

Before you begin, make sure that you have successfully set up your integration points.

👍

This guide will help you to:

  • Generate credentials for your mobile app.
  • Add data to the "APNs connection settings" form for a relevant integration point.

When enabling mobile push notifications for an iOS app, you will need a keychain of four keys:

  • Bundle ID;
  • Team ID;
  • Key ID;
  • Token (file with the .p8 extension).

You can obtain them through your Apple Developer Account or in the settings of your push notifications service.

Key ID and Token

Once you generate a token on Apple’s website, you are given a single try to download it. If you fail to save the value as soon as it is generated and you cannot copy it from the settings of another push notification provider, you will have to generate a new file.

To get Key ID and Token:

  1. Open the Apple Developer console at https://developer.apple.com/account/.
  2. Go to Certificates, Identifiers & Profiles.
  3. Open the Keys tab.
  4. Click the "+" button.
  5. Type in the key name and tick Apple Push Notifications service (APNs). The other boxes are optional for push notifications.
  6. Set up the integration settings.
2980

The Certificates, Identifiers & Profiles section

2496

The Keys tab with the button to add a new key

2362

Setting up a new certificate

As a result, you will get:

  • A 10-char Key ID string;
  • A text file (.p8) with your Authentication Token.
2338

Certificate download button

📘

Store your token in a safe place

The Apple website gives you a single try to download your token, so store it securely to avoid having to re-generate a new one.

If you’re unable to tick APNs when creating a token

Apple limits the number of certificates you can use to connect to APNs. Therefore, when unable to generate new tokens from your own account, open one of your current tokens, revoke it, and re-generate.

2418

Certificate revocation button

Bundle ID and Team ID

Next, you need to get a Bundle ID and Team ID:

  1. Go back to the Apple Developer account homepage: https://developer.apple.com/account/.
  2. Go to Certificates, Identifiers & Profiles.
  3. Go to the Identifiers tab.
  4. Find the app name and open it.
  5. Copy the values of your App ID Prefix and Bundle ID, available in the right column. Input these in integration settings.
2510

The Identifiers tab

2518

Bundle ID and Team ID

Integration settings

Input the keychain into the integration point fields. This is the point you added and set up in one of the previous steps — Setting up Integration Points for Your iOS App.

1798