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:
- Open the Apple Developer console at https://developer.apple.com/account/.
- Go to Certificates, Identifiers & Profiles.
- Open the Keys tab.
- Click the "+" button.
- Type in the key name and tick Apple Push Notifications service (APNs). The other boxes are optional for push notifications.
- Set up the integration settings.
As a result, you will get:
- A 10-char Key ID string;
- A text file (
.p8
) with your Authentication Token.
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.
Bundle ID and Team ID
Next, you need to get a Bundle ID and Team ID:
- Go back to the Apple Developer account homepage: https://developer.apple.com/account/.
- Go to Certificates, Identifiers & Profiles.
- Go to the Identifiers tab.
- Find the app name and open it.
- Copy the values of your App ID Prefix and Bundle ID, available in the right column. Input these in integration settings.
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.
Updated about 1 year ago