Apple Push Notification Service (APNs)
Integrate Apple Push Notification service (APNs) with Enbbox. Setup guide with p8 key, team ID, and bundle ID configuration for iOS push notifications.
Overview
Apple Push Notification Service (APNs) is Apple's platform for delivering push notifications to iOS, macOS, watchOS, and tvOS devices.
[!IMPORTANT] APNs requires an Apple Developer account ($99/year) and either a
.p8authentication key or a.p12certificate.
Prerequisites
- An Apple Developer Program membership
- An app with push notification capability enabled
- Your app registered with a Bundle ID in the Apple Developer portal
Step 1: Create an APNs Authentication Key (.p8)
The .p8 key is recommended — it never expires and works for all apps in your team.
- Go to developer.apple.com/account/resources/authkeys
- Click the + button to create a new key
- Enter a key name (e.g., "Enbbox Push")
- Check Apple Push Notifications service (APNs)
- Click Continue → Register
- Download the
.p8file — you can only download it once
You'll also need:
- Key ID — shown on the key details page (10-character string)
- Team ID — found in your Apple Developer membership page
Step 2: Connect to Enbbox
- Navigate to Integrations in the Enbbox dashboard
- Click Add Provider → select Push → APNs
- Enter your credentials:
- Private Key — paste the contents of the
.p8file - Key ID — the 10-character key identifier
- Team ID — your Apple Developer Team ID
- Bundle ID — your app's bundle identifier (e.g.,
com.myapp.ios)
- Private Key — paste the contents of the
- Select Environment:
sandboxfor development,productionfor App Store builds - Click Test Connection to verify
- Activate the integration
[!WARNING] Use sandbox for development/TestFlight builds and production for App Store releases. Using the wrong environment will cause silent delivery failures.
Step 3: Register Device Tokens
In your iOS app, request push permission and register the device token:
// AppDelegate.swift
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
// Send this token to your backend
}Store it in Enbbox:
import { SubscriberCredentialsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const credentialsApi = new SubscriberCredentialsApi(config);
await credentialsApi.setCredentials("subscriber-123", "apns", {
credentials: { device_tokens: [token] },
});Step 4: Send a Test Notification
import { EventsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const eventsApi = new EventsApi(config);
await eventsApi.triggerEvent({
name: "appointment-reminder",
to: { subscriberId: "subscriber-123" },
payload: {
title: "Appointment Tomorrow",
body: "Your appointment is scheduled for 10:00 AM",
},
});Troubleshooting
| Issue | Solution |
|---|---|
BadDeviceToken | Token was generated for different environment (sandbox vs production) |
ExpiredProviderToken | Your .p8 key is correct but check Team ID and Key ID |
TopicDisallowed | Bundle ID doesn't match the app's push entitlement |
| Notification not received | Ensure the device has granted push permission |
Firebase Cloud Messaging (FCM)
Integrate Firebase Cloud Messaging (FCM) with Enbbox for Android and web push notifications. Setup guide with service account credentials.
Expo Push
Integrate Expo Push Notifications with Enbbox. Setup guide for sending push notifications to Expo-managed React Native apps.