Skip to main content

APNs certificates and tokens

Create an APNs provider certificate

Push certificates for development and production .

  1. Log in to the Apple Developer Program Portal.
  2. Go to Certificates, Identifiers & Profiles.
  3. From the left-side menu, select App IDs.
  4. Create an App ID without a wildcard, if it does not already exist.
    Example

    3L223ZX9Y3.com.armiento.test

  5. Under Enable Services, enable Push Notifications.
  6. Click on the App ID, then click the edit button.
  7. Click Create certificate To start the wizard to generate a new Development Push SSL Certificate.
  8. Download this certificate, then double-click on aps_developer_identity.cer to import it into your Keychain.
  9. Launch Keychain Access, then on the left, click on My Certificates.
    Where to find Keychain Access

    This is located in Application > Utilities. You can also search for it with Spotlight.

  10. Expand Apple Development Push Services, then select Apple Development Push Services and your private key.
  11. Right-click, then choose Export 2 items....
  12. Save as .p12 and put in encap/core/config folder:

Create an APNs provider authentication token

  1. Log in to the Apple Developer Program Portal.
  2. Go to Certificates, Identifiers & Profiles.
  3. From the left-side menu, select Keys.
  4. Select Apple Push Notifications service (APNs), then enter a name for the token and click Continue.
  5. Copy the KeyID, then download the token and store it in a secure place.
Configure in the application configuration

The steps above show you how to create an APNs provider authentication token.

To configure it in the application configuration, you also need the TeamID and BundleID for the application.

To obtain these, see the How to find the TeamID and How to find the BundleID sections below.

How to find the TeamID

The TeamID can be found in the membership details. To do this:

  1. Log in to the Apple Developer Program Portal.
  2. Go to Membership.

How to find the BundleID

The BundleID can be found under Identifiers. To do this:

  1. Log in to the Apple Developer Program Portal.
  2. Go to Certificates, Identifiers & Profiles.
  3. From the left-side menu, select Identifiers.
  4. Select the application that you are configuring the APNs token for.

Troubleshooting

iOS Push notification not arriving

The following steps will show you how to investigate why push notifications from the Encap server are not arriving at the client.

Check whether you are using the correct application ID

  • This could happen if the iOS application is using the incorrect application ID.
    Example

    The iOS application apiTest is using application ID encapApiTest.

Check whether the certificate on the Encap server has expired.

  1. Log in to the server, and locate the config folder: .../encap/core/config
  2. List the Keystore containing the certificate to be investigated <applicationID>-apns.p12.
Example
  1. List encapApiTest-apns.p12.
  2. Run keytool -list -v -keystore encap/core/config/encapApiTest-apns.p12.
  3. Press enter when prompted for the password.
  4. Locate the period of validity field. For example Valid from: Tue Jan 02 10:08:49 UTC 2024 until: Fri Jan 31 10:08:48 UTC 2025.
Diagram showing locating period of validity field

Diagram showing locating period of validity field