Skip to content

Commit a1ac961

Browse files
mattheworiordanm-hulbert
authored andcommitted
docs(push): clarify APNs sandbox endpoint requirements
Update APNs documentation to clarify that users must specify the sandbox/production endpoint for both authentication methods: - Token-based auth (.p8): Must specify endpoint (same key works for both) - Certificate-based auth (.p12): Must specify endpoint and match with certificate type (development cert = sandbox, distribution cert = production) Changes: - Add "Why token-based authentication is recommended" section with comparison table and link to Apple docs - Update Control API docs to explain apnsUseSandboxEndpoint field - Remove references to auto-detection (not implemented) Ref: PDR-088, EDU-1652
1 parent ff5740b commit a1ac961

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

src/pages/docs/platform/account/control-api.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ curl --location --request POST 'https://control.ably.net/v1/accounts/${ACCOUNT_I
240240
```
241241
</Code>
242242

243+
<Aside data-type='note'>
244+
The `apnsUseSandboxEndpoint` field controls which [APNs endpoint](https://developer.apple.com/documentation/usernotifications/sending-notification-requests-to-apns) Ably uses to deliver push notifications. Set to `true` for the sandbox endpoint `api.sandbox.push.apple.com` or `false` for the production endpoint `api.push.apple.com`.
245+
246+
You must specify this field for both token-based (.p8) and certificate-based (.p12) authentication. Use sandbox when testing with development builds and production for App Store or TestFlight distribution.
247+
248+
For certificate-based authentication, ensure the endpoint matches your certificate type. Use a development certificate for sandbox, and a distribution certificate for production.
249+
</Aside>
250+
243251
See the [API reference](/docs/api/control-api/#tag/apps/paths/~1accounts~1{account_id}~1apps/post) for information on the request body.
244252

245253
Sample response:

src/pages/docs/push/configure/device.mdx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,23 @@ To enable push notifications for iOS devices, you need to configure your app to
4343
1. Use [token-based](#token) authentication (recommended) with a **.p8 file**.
4444
2. Use [certificate-based](#cert) authentication with a **.p12** or **.cer** file.
4545

46-
#### Token-based authentication <a id="token"/>
46+
#### Token-based authentication (recommended) <a id="token"/>
4747

48-
Use token-based authentication for new or updated apps because it is easier to manage and does not require yearly renewal like certificates. Token-based authentication relies on a private key (.p8) instead of .p12 certificates, making it the preferred choice for modern push notification setups.
48+
Use token-based authentication for new or updated apps. Apple recommends this approach and is [actively deprecating certificate-based authentication](https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns).
49+
50+
Token-based authentication is recommended for the following reasons:
51+
52+
| Aspect | Certificate (.p12) | Token (.p8) |
53+
| ------ | ------------------ | ----------- |
54+
| Expiration | Expires annually, requires renewal | Never expires, unless manually revoked |
55+
| Scope | One certificate per app | One key works for all apps in your team |
56+
| Management | Manual renewal, export from Keychain | Simpler, easier CI/CD automation |
57+
58+
<Aside data-type='note'>
59+
For both authentication methods, you must specify whether to use the sandbox or production APNs endpoint. Use sandbox when testing with development builds from Xcode, and production when distributing via App Store or TestFlight.
60+
61+
You are responsible for matching the endpoint selection with your certificate type. Use a development certificate for sandbox, and a distribution certificate for production.
62+
</Aside>
4963

5064
* **Download the .p8 file**:
5165
* Go to the [Apple Developer Program](https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns) and sign in.

0 commit comments

Comments
 (0)