APNs device token never delivered — didRegisterForRemoteNotifications never fires (works fine for other apps on same device)

Summary

On a physical iPhone, the app never receives an APNs device token (application:didRegisterForRemoteNotificationsWithDeviceToken: never fires, even after waiting 60 seconds after login and calling registerForRemoteNotifications). The symptom reproduces identically in two different apps (different bundle IDs, same Team), over both WiFi and cellular data, even after a full device restart. Other apps on the same device (WhatsApp, Gmail, etc.) receive push notifications normally.

Account details

  • Team ID: 6NJN39FM4A
  • Program: Apple Developer Program (Individual), active through June 26, 2027, no pending payments or agreements
  • Signing Apple ID: my developer Apple ID (account in good standing)

Affected apps (same issue in both)

  • com.movicolombia.driver
  • com.movicolombia.passenger

For both App IDs, in Certificates, Identifiers & Profiles, the Push Notifications capability is checked/enabled (Environment: Sandbox & Production, Key Restriction: Team Scoped).

Test device

  • Physical iPhone, iOS 26.5.2, installed directly via Xcode (flutter run --release, automatic signing, development provisioning profile — not TestFlight or App Store)

Configuration already verified as correct

  1. Correctly signed entitlements: confirmed by inspecting the device system log at launch time — the embedded entitlement includes aps-environment: development and the correct application-identifier.
  2. Push Notifications capability added in Xcode (Signing & Capabilities) for both targets, with Automatically manage signing on, no signing/provisioning errors in the build.
  3. APNs authentication key (.p8) uploaded in Firebase Console → Cloud Messaging → Apple app configuration, applied to both the development and production rows.
  4. Notification permission granted by the user (confirmed in Settings).
  5. No active Content & Privacy Restrictions.
  6. No VPN or device management profiles installed.
  7. Active iCloud account on the device with the same development Apple ID.

Troubleshooting already performed (all unsuccessful)

  • Full app reinstall
  • Full device restart
  • Test over WiFi — getAPNSToken() nil after 60s
  • Test over cellular data (WiFi off) — same result
  • Full build cache wipe (flutter clean + deleting ~/Library/Developer/Xcode/DerivedData) and rebuild from scratch, to rule out a stale binary
  • Test with a second app (different bundle ID) on the same device — same exact failure

Technical detail

After registerForRemoteNotifications is invoked (automatically, by the Firebase Messaging SDK on app launch), neither didRegisterForRemoteNotificationsWithDeviceToken: nor didFailToRegisterForRemoteNotificationsWithError: is ever called. As a result, FirebaseMessaging.getAPNSToken() (Flutter/FlutterFire) returns nil indefinitely, and getToken() throws:

[firebase_messaging/apns-token-not-set] APNS token has not been set yet. Please ensure the APNS token is available by calling getAPNSToken().

I instrumented a polling loop calling getAPNSToken() every second for 60 seconds after login — across more than 10 test runs (WiFi, cellular, before/after device restart) it never returned a non-nil value.

What I'm hoping to learn

Whether there's something on Apple's side (APNs service state, account/ Team status, or this specific device) preventing this iPhone from completing push registration for apps signed with this Team ID — since I've ruled out every app-level, Xcode-level, and Firebase-level configuration issue I could think of.

Thank you for the post. I would really encourage you to provide us a sample focused test project using Xcode instead of Firebase and Flutter.

Do yo have the same issue when you use the sample push notification with Xcode? https://developer.apple.com/documentation/usernotifications/implementing-alert-push-notifications

When neither callback fires, the issue could be between the Flutter/Firebase SDK, a silent failure within the environment mismatch. First, to help narrow your focus: APNs device token generation device → APNs. Verify the swizzling trap as you mentioned that getAPNSToken() returns nil, because you are using FlutterFire, Firebase utilizes swizzling to intercept. I would recommend to contact Firebase about the issue.

If you see the NATIVE LOG in your Xcode console but Flutter still returns nil, the issue is purely within the Flutter/Firebase SDK (likely FirebaseAppDelegateProxyEnabled is set to NO in your Info.plist, or another plugin is overriding the AppDelegate?

I would recommend if the Xcode sample works to work with Flutter and Firebase for the correct configuration.

Albert  WWDR

APNs device token never delivered — didRegisterForRemoteNotifications never fires (works fine for other apps on same device)
 
 
Q