Product Benefits Pricing Guides Docs About Contact us Try it out
Engagement

PostHog iOS SwiftUI APNs Callback Tracking

PostHog iOS APNs callback tracking for SwiftUI apps: check push token registration after the 3.69.7 fix for UIApplicationDelegateAdaptor.

· 3 min read

PostHog iOS 3.69.7 fixes a bug where APNs registration callbacks were swallowed in SwiftUI apps that use @UIApplicationDelegateAdaptor. If your app is built that way, some devices may never have sent a push token to PostHog.

The SDK began registering APNs tokens in 3.69.0, and it is on by default. A silent failure here means push campaigns that reach fewer people than you think.

Why This Metric Matters

Push is only as good as your token coverage. If a device never registers, you cannot message it, and nothing in your dashboards says so. Your delivery numbers look fine because they only count users you can reach.

The risk is highest for SwiftUI apps with their own app delegate. The callbacks that return the token pass through that delegate. A bug there removes tokens without any crash or error.

Data Points to Track

Capture these around the upgrade:

  • sdk_version: the PostHog iOS version on each user
  • push_permission_status: granted, denied or not asked
  • apns_registration_requested (true or false)
  • apns_token_received (true or false)
  • apns_registration_error: the error code, if any
  • uses_delegate_adaptor (true or false)
  • push_token_registered_with_posthog (true or false)
  • time_to_token_seconds: from request to token
  • capturePushNotificationSubscriptions and capturePushNotificationOpened settings
  • app_version and os_version

Setup Steps

  1. Check your app entry point. Look for @UIApplicationDelegateAdaptor.
  2. Upgrade posthog-ios to 3.69.7 or later.
  3. Confirm that your delegate still implements the remote notification registration methods.
  4. Log apns_token_received when the system hands your app a token.
  5. Log push_token_registered_with_posthog when PostHog confirms it has the token.
  6. Test on a real device, not the simulator, with permission granted.
  7. Compare the share of permitted users with a registered token for the old and new versions.
  8. Set the notification delegate early at launch, so taps that open the app are not lost.

Actionable Insights

Token coverage is lower than permission coverage. The gap is lost reach. After the upgrade, it should shrink for delegate adaptor apps.

Coverage rises only on the new version. Older versions will not recover on their own. Prompt users to update, or accept that those devices will register after they upgrade.

Many permission grants but few tokens. Look for registration errors before blaming users.

Opens are low but tokens are healthy. The problem is the message or timing, not registration.

Both settings are off. If you turned the capture flags off, you will not see these events. That is a choice, but make it on purpose.

Common Mistakes to Avoid

Do not test only on the simulator. Do not treat permission granted as a token received. And do not count push reach from sent messages alone, since that hides every device you could not register.