Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
iOS
Description
After upgrading firebase_messaging from 16.4.3 to 16.5.0, physical iOS devices running a UIScene-based Flutter app never receive the APNs device token, so FCM tokens can never be obtained and push notifications are completely broken.
FirebaseMessaging.instance.getAPNSToken() returns null indefinitely (polled every 500ms for 3s, still null 11+ seconds after launch).
FirebaseMessaging.instance.getToken() throws [firebase_messaging/apns-token-not-set] APNS token has not been received on the device yet.
onTokenRefresh never fires.
- Notification permission is already authorized;
aps-environment entitlement is present (development for debug, production for release); pushes to previously-obtained tokens still arrive, so certificates/entitlements are fine.
This is a regression from 16.4.3: the identical app (same UIScene setup, same AppDelegate, same entitlements) ran in production alongside UIScene for five months on 16.4.3 with working push. The only change was the plugin upgrade to 16.5.0. Pinning back to 16.4.3 immediately restores APNs token delivery on the same device.
We did apply the new 16.5.0 UIScene guidance: FLTFirebaseMessagingPlugin.configureNotificationCenterDelegate() is called in application(_:didFinishLaunchingWithOptions:) before returning super.... That fixes the notification-center delegate setup, but the APNs device token registration path (didRegisterForRemoteNotificationsWithDeviceToken → FIRMessaging) still appears to be broken under scene-based lifecycle — the token never reaches the SDK.
App setup:
Info.plist contains UIApplicationSceneManifest with UISceneDelegateClassName = FlutterSceneDelegate (adopted 5 months ago, worked with 16.4.3).
AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate (plugins registered in didInitializeImplicitFlutterEngine).
- Method swizzling enabled (no
FirebaseAppDelegateProxyEnabled key; no manual didRegisterForRemoteNotifications forwarding).
setAutoInitEnabled(true) is called explicitly at startup.
Reproducing the issue
- Flutter app with UIScene adoption (
UIApplicationSceneManifest + FlutterSceneDelegate) and FlutterAppDelegate + FlutterImplicitEngineDelegate.
firebase_messaging: 16.5.0, call FLTFirebaseMessagingPlugin.configureNotificationCenterDelegate() in didFinishLaunchingWithOptions per the 16.5.0 README.
- Run on a physical iPhone with notification permission granted.
- Call
getAPNSToken() (null forever) then getToken() → throws apns-token-not-set.
- Downgrade only
firebase_messaging to 16.4.3 (and remove the 16.5-only delegate call) → APNs token arrives, getToken() succeeds.
Firebase Core version
4.x (Podfile.lock: Firebase iOS SDK 12.17.0)
Flutter Version
3.41.9 (stable)
Relevant Log Output
[firebase_messaging/apns-token-not-set] APNS token has not been received on the device yet. Please ensure the APNS token is available by calling `getAPNSToken()`.
Additional context and comments
Workaround for anyone hitting this: pin firebase_messaging: 16.4.3 and remove/comment the configureNotificationCenterDelegate() call (16.5-only API).
Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
iOS
Description
After upgrading
firebase_messagingfrom 16.4.3 to 16.5.0, physical iOS devices running a UIScene-based Flutter app never receive the APNs device token, so FCM tokens can never be obtained and push notifications are completely broken.FirebaseMessaging.instance.getAPNSToken()returnsnullindefinitely (polled every 500ms for 3s, still null 11+ seconds after launch).FirebaseMessaging.instance.getToken()throws[firebase_messaging/apns-token-not-set] APNS token has not been received on the device yet.onTokenRefreshnever fires.aps-environmententitlement is present (development for debug, production for release); pushes to previously-obtained tokens still arrive, so certificates/entitlements are fine.This is a regression from 16.4.3: the identical app (same UIScene setup, same AppDelegate, same entitlements) ran in production alongside UIScene for five months on 16.4.3 with working push. The only change was the plugin upgrade to 16.5.0. Pinning back to 16.4.3 immediately restores APNs token delivery on the same device.
We did apply the new 16.5.0 UIScene guidance:
FLTFirebaseMessagingPlugin.configureNotificationCenterDelegate()is called inapplication(_:didFinishLaunchingWithOptions:)before returningsuper.... That fixes the notification-center delegate setup, but the APNs device token registration path (didRegisterForRemoteNotificationsWithDeviceToken→ FIRMessaging) still appears to be broken under scene-based lifecycle — the token never reaches the SDK.App setup:
Info.plistcontainsUIApplicationSceneManifestwithUISceneDelegateClassName = FlutterSceneDelegate(adopted 5 months ago, worked with 16.4.3).AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate(plugins registered indidInitializeImplicitFlutterEngine).FirebaseAppDelegateProxyEnabledkey; no manualdidRegisterForRemoteNotificationsforwarding).setAutoInitEnabled(true)is called explicitly at startup.Reproducing the issue
UIApplicationSceneManifest+FlutterSceneDelegate) andFlutterAppDelegate+FlutterImplicitEngineDelegate.firebase_messaging: 16.5.0, callFLTFirebaseMessagingPlugin.configureNotificationCenterDelegate()indidFinishLaunchingWithOptionsper the 16.5.0 README.getAPNSToken()(null forever) thengetToken()→ throwsapns-token-not-set.firebase_messagingto 16.4.3 (and remove the 16.5-only delegate call) → APNs token arrives,getToken()succeeds.Firebase Core version
4.x (Podfile.lock: Firebase iOS SDK 12.17.0)
Flutter Version
3.41.9 (stable)
Relevant Log Output
[firebase_messaging/apns-token-not-set] APNS token has not been received on the device yet. Please ensure the APNS token is available by calling `getAPNSToken()`.Additional context and comments
Workaround for anyone hitting this: pin
firebase_messaging: 16.4.3and remove/comment theconfigureNotificationCenterDelegate()call (16.5-only API).