Generate an iOS .p8 Key for Token-Based Connection to APNS

A step-by-step guide on how to create an iOS .p8 Certificate for Token-Based Connection to Apple Push Notification Servers (APNS).

An authenticated connection to APNS is required to send push notifications to all iOS mobile apps. You only need to use one authentication method, either token-based (.p8) or certificate-based (.p12).

Step 1. Requirements

  • An iOS mobile app
  • A paid Apple Developer Account with Admin Role
  • iZooto Account
  • A Mac computer with Xcode 11+
  • Your Xcode project should have the Push Notification capability added. Otherwise, your project may not be shown in the Apple Developer Center.

Step 2. Generate a new .p8 Key

Log in to your paid Apple Developer Account and navigate to Certificates, Identifiers & Profiles -> Keys and select the Blue + button.

Apple Developer Account - Keys page

Apple Developer Account - Keys page

Select Apple Push Notification Service (APNS), and enter a name for the key.

Apple Developer Account - Register a New Key Page. Select APNS

Apple Developer Account - Register a New Key Page. Select APNS

Select Continue and on the next page, select Register.

Download your new key and save it in a secure place. You can only download it once, so do not lose it. Then, click Done and you will have a new key.

🚧

Previous Token Revokation

You can have up to two .p8 keys in your Apple Account. If you need to generate a third key, you will need to revoke one of your existing keys and it can no longer be used.

Note: .p8 keys are in the "keys" section of the Apple developer account and the .p12 certificates are under "certificates". In your Apple account, you can only have two .p8 keys, but you can have both active .p12s and .p8s.

Step 3. Upload your Push Key to iZooto

3.1 On the iZooto dashboard, select your iOS app, and then go to Settings > Setup.

Uploading APNS .p8 Auth Key for iOS app

Uploading APNS .p8 Auth Key for iOS app

3.2 Under APNS Credentials, select APNS .p8 Auth Key.

3.3 Upload the downloaded .p8 file. You will also need:

  • Team ID - A Team ID is generated by Apple for your developer account.
  • Key ID - This is the unique identifier for the authentication key. You can find your Key ID in the keys section of your Apple developer account.
  • Bundle ID - A Bundle ID identifies your app in the Apple ecosystem. You can find your Bundle ID in the app information section of your Apple Developer account.

3.4 Select the APNS Push Mode - Sandbox or Production.

3.5 Click Save.

πŸ‘

Done!

You should now be finished generating your iOS Authentication Key and uploading it to iZooto.