From d6bf9e6a52a786a2d2f21a858625b2cd251a3c0d Mon Sep 17 00:00:00 2001 From: Jude Kwashie Date: Tue, 29 Sep 2026 05:53:14 +0000 Subject: [PATCH] fix(messaging,ios): return NO from scene willConnectToSession Flutter reads this callback as BOOL. A void method leaves that value undefined, so a cold-start connection can be treated as handled and its deep links dropped. --- .../firebase_messaging/FLTFirebaseMessagingPlugin.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/firebase_messaging/firebase_messaging/ios/firebase_messaging/Sources/firebase_messaging/FLTFirebaseMessagingPlugin.m b/packages/firebase_messaging/firebase_messaging/ios/firebase_messaging/Sources/firebase_messaging/FLTFirebaseMessagingPlugin.m index e227230256e4..b87d88e6bf39 100644 --- a/packages/firebase_messaging/firebase_messaging/ios/firebase_messaging/Sources/firebase_messaging/FLTFirebaseMessagingPlugin.m +++ b/packages/firebase_messaging/firebase_messaging/ios/firebase_messaging/Sources/firebase_messaging/FLTFirebaseMessagingPlugin.m @@ -817,7 +817,11 @@ - (BOOL)application:(UIApplication *)application #pragma mark - SceneDelegate Methods #if !TARGET_OS_OSX -- (void)scene:(UIScene *)scene +// FlutterSceneLifeCycleDelegate declares this as BOOL. YES means this plugin +// consumed the connection, which skips Flutter's cold-start deep link delivery +// and passes nil options to later plugins. Messaging only reads +// notificationResponse, so always return NO. +- (BOOL)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { // Handle launch notification if present @@ -836,6 +840,7 @@ - (void)scene:(UIScene *)scene [self setupNotificationHandlingWithRemoteNotification:remoteNotification actionIdentifier:actionIdentifier]; + return NO; } #endif