Skip to content

APNs (iOS)

Apple Push Notification service (APNs) delivers push notifications to iOS devices. Entrig uses an APNs auth key to send notifications. Auth keys do not expire and work across all your apps, making them simpler to manage than certificates.


What you’ll need

  • An Apple Developer account (paid, $99/year)
  • An APNs auth key (.p8 file), created in Apple Developer under Certificates, Identifiers & Profiles → Keys → +. Make sure to enable Apple Push Notifications service (APNs) when creating the key.
  • Your Key ID, shown next to the key name in Apple Developer
  • Your Team ID, found in Apple Developer under Membership Details
  • Your app’s Bundle ID, found under Identifiers in Apple Developer (e.g. com.example.myapp)

Production vs Sandbox

Entrig supports two independent APNs environments:

  • Production: for App Store releases and TestFlight builds
  • Sandbox: for development builds run directly from Xcode

You can configure one or both. If you only configure Production, Sandbox builds will not receive notifications. Updating one environment never affects the other; they are stored independently.


Configure

  1. Open Channels → Push in Settings

    From the Entrig dashboard, go to Settings → Channels. Under the Push section, find APNs and click Configure.

  2. Select the environment tab

    Choose Production or Sandbox depending on which you are setting up.

  3. Upload your P8 key file

    Click Choose File and select the .p8 file downloaded from Apple Developer.

  4. Enter your identifiers

    Fill in Team ID, Bundle ID, and Key ID. All three are required.

  5. Save

    Click Save. Switch to the other tab and repeat if you want to configure both environments.


Troubleshooting

iOS notifications not arriving in production but working in development

Cause: Your production app is pointing at the Sandbox APNs endpoint, or you only configured Sandbox in Entrig.

Fix: Make sure you have configured the Production environment in Entrig, and that your app is built with a production provisioning profile.

”BadDeviceToken” errors in logs

Cause: The device token registered by the SDK doesn’t match the APNs environment. Sandbox tokens are rejected by the production APNs endpoint and vice versa.

Fix: Ensure the isSandbox parameter in your SDK’s registerDevice call matches the environment your app was built for. Development/Xcode builds use Sandbox; App Store and TestFlight builds use Production.

”InvalidProviderToken” errors

Cause: The Team ID, Key ID, or Bundle ID doesn’t match the uploaded .p8 key.

Fix: Double-check all three identifiers against your Apple Developer account and re-save.

The .p8 file won’t upload

Cause: Some browsers restrict file input to specific extensions. The .p8 extension is not a common MIME type.

Fix: Try a different browser, or rename the file to .p8.txt temporarily, upload it, then rename back (the content is plain text).