Configure Apple Push Notifications
This page describes the steps to configure Apple Push Notification service (APNs) with TalkJS.
To ensure your app properly handles push notifications, you need to enable the following two capabilities in your Xcode project:
- From
Background Modes
, select theRemote notifications
capability - Select
Push Notifications
capability
Follow the Apple Developer guide on adding capabilities to your app.
To configure APNs using an authentication token signing key, add the following to the Settings page of your TalkJS dashboard:
- a token signing key (
.p8
file format only)- If you don't have a token signing key, follow the steps to obtain a token signing key.
- the Key ID for the authentication token signing key you want to use
- your Apple Developer Team ID
- a bundle ID for each app you want to receive push notifications
- If you provide multiple bundle IDs, add the bundle IDs as a comma-separated list.
You now have configured APNs using an authentication token signing key. Authentication token signing keys don't expire, so you can set this up once and forget about it.
To obtain an APNs authentication token signing key from Apple, take the following steps:
- Login to your Apple Developer account on developer.apple.com.
- In the Certificates, Identifiers & Profiles section, click Keys.
- Click the + (plus) button to create a new key.
- Enter a Key Name and select the enable checkbox for Apple Push Notifications service (APNs).
- Click Continue, and then click Register.
- Apple gives you an authentication token signing key, specified as a text file (with a
.p8
file extension) and displays a 10-character string with the Key ID. Save the key file and copy the Key ID.
You now have an authentication token signing key and its associated Key ID that you need to configure APNs.
Configuring APNs using a .p12
certificate is deprecated. Push notifications will continue to work as long as your certificate remains valid and hasn't expired.
If your certificate has expired or is marked as an "Invalid configuration", you need to configure APNs using a token signing key.