Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    flutter – firebase_messaging onMessage stream never fires after UIScene migration on iOS

    April 15, 2026

    Grief and the Nonprofessional Programmer – O’Reilly

    April 15, 2026

    AI data center startup Fluidstack in talks for $1B round at $18B valuation months after hitting $7.5B, says report

    April 15, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»flutter – firebase_messaging onMessage stream never fires after UIScene migration on iOS
    iOS Development

    flutter – firebase_messaging onMessage stream never fires after UIScene migration on iOS

    big tee tech hubBy big tee tech hubApril 15, 2026003 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    flutter – firebase_messaging onMessage stream never fires after UIScene migration on iOS
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    After migrating a Flutter iOS app to use UISceneDelegation (via FlutterSceneDelegate in Info.plist), FirebaseMessaging.onMessage in Dart never fires for foreground messages. Background banners appear correctly via APNs, but the Dart layer receives nothing — no onMessage, no onMessageOpenedApp logs, and no getInitialMessage data.

    What works:

    • FCM token is generated and non-null

    • Push notification banners appear when the app is backgrounded

    • didRegisterForRemoteNotificationsWithDeviceToken fires correctly

    • UNUserNotificationCenter willPresent fires correctly (confirmed via Swift print)

    • Messaging.messaging().appDidReceiveMessage(userInfo) is called successfully from willPresent

    What breaks:

    • FirebaseMessaging.onMessage never fires in Dart

    • FirebaseMessaging.onMessageOpenedApp never fires in Dart

    • No Dart-side logs appear for any incoming notification

    • Root Cause (Diagnosed): When using FlutterImplicitEngineDelegate, plugins are registered via: func didInitializeImplicitFlutterEngine(\_ engineBridge: FlutterImplicitEngineBridge) { GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) }, After GeneratedPluginRegistrant.register runs, FLTFirebaseMessagingPlugin is expected to set itself as Messaging.messaging().delegate. However, printing the delegate immediately after registration reveals: print(Messaging.messaging().delegate) // → nil

    This did not occur before the UIScene migration, when GeneratedPluginRegistrant.register(with: self) was called in didFinishLaunchingWithOptions and FlutterAppDelegate (which lives for the app’s lifetime) held the plugins strongly.

    This is my appdelegate.swift file:

    import Flutter
    import Firebase
    import UserNotifications
    import flutter_local_notifications
    @main
    @objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
      override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
      ) -> Bool {
        FirebaseApp.configure()
        UNUserNotificationCenter.current().delegate = self
        let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
        UNUserNotificationCenter.current().requestAuthorization(options: authOptions) { _, _ in }
        application.registerForRemoteNotifications()
    //     GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
      }
      func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
      // This is required to make any communication available in the action isolate.
          FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
              GeneratedPluginRegistrant.register(with: registry)
          }
          GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
        }
      override func application(_ application: UIApplication,
                                didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        Messaging.messaging().apnsToken = deviceToken
    //     print("✅ APNs token: \(deviceToken.map { String(format: "%02x", $0) }.joined())")
        super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
      }
    //   override func application(_ application: UIApplication,
    //                             didReceiveRemoteNotification userInfo: [AnyHashable : Any],
    //                             fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    //     Messaging.messaging().appDidReceiveMessage(userInfo)
    //     completionHandler(.newData)
    //   }
    }
    

    And this is my info.plist file:

    
    
        
        UIApplicationSceneManifest
         
          UIApplicationSupportsMultipleScenes
          
          UISceneConfigurations
          
          UIWindowSceneSessionRoleApplication
            
              
                UISceneClassName
                UIWindowScene
                UISceneDelegateClassName
                FlutterSceneDelegate
                UISceneConfigurationName
                flutter
                UISceneStoryboardFile
                Main
              
            
           
         
           CFBundleDevelopmentRegion
           $(DEVELOPMENT_LANGUAGE)
           CFBundleDisplayName
           Bongo Payments
           CFBundleExecutable
           $(EXECUTABLE_NAME)
           CFBundleIdentifier
           $(PRODUCT_BUNDLE_IDENTIFIER)
           CFBundleInfoDictionaryVersion
           6.0
           CFBundleName
           bongo_pay
           CFBundlePackageType
           APPL
           CFBundleShortVersionString
           $(FLUTTER_BUILD_NAME)
           CFBundleSignature
           ????
           UIBackgroundModes
           
              remote-notification
           
           FirebaseAppDelegateProxyEnabled
           
           NSAppTransportSecurity
           
              NSAllowsArbitraryLoads
              
           
           CFBundleVersion
           $(FLUTTER_BUILD_NUMBER)
           NSLocationWhenInUseUsageDescription
           We need your location to provide better service.
           NSLocationAlwaysAndWhenInUseUsageDescription
           This app uses notifications
           NSLocationAlwaysUsageDescription
           We need your location even when the app is in the background.
           NSUserTrackingUsageDescription
           This app uses notifications
           LSRequiresIPhoneOS
           
           UILaunchStoryboardName
           LaunchScreen
           UIMainStoryboardFile
           Main
           NSFaceIDUsageDescription
           This app requires Face ID authentication to secure your personal data and ensure only you can access your account.
           NSCameraUsageDescription
           We need access to your camera to take photos.
           NSPhotoLibraryUsageDescription
           We need access to your photo library to upload images.
           NSAppleMusicUsageDescription
            This app does not use Apple Music but requires limited media library access for system features.
           UISupportedInterfaceOrientations
           
              UIInterfaceOrientationPortrait
              UIInterfaceOrientationLandscapeLeft
              UIInterfaceOrientationLandscapeRight
           
           UISupportedInterfaceOrientations~ipad
           
              UIInterfaceOrientationPortrait
              UIInterfaceOrientationPortraitUpsideDown
              UIInterfaceOrientationLandscapeLeft
              UIInterfaceOrientationLandscapeRight
           
           CADisableMinimumFrameDurationOnPhone
           
           UIApplicationSupportsIndirectInputEvents
           
           io.flutter.embedded_views_preview
           
           NSMicrophoneUsageDescription
           We need access to your microphone for video or audio capture in web pages.
           NSPhotoLibraryAddUsageDescription
           We need access to save images to your photo library.
           UIFileSharingEnabled
           
           LSSupportsOpeningDocumentsInPlace
           
           UIStatusBarHidden
           
        
    
    



    Source link

    firebase_messaging fires Flutter iOS migration onMessage Stream UIScene
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    swift – Flutter iOS: USSD code with * and # not launching in phone dialer (works on Android)

    April 14, 2026

    Firebase App Check debug token returns 403 “App attestation failed” on iOS Flutter app — misleading error hides API key restriction

    April 13, 2026

    javascript – React Native iOS app crashes on language change with react-native-restart (works on Android)

    April 12, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    flutter – firebase_messaging onMessage stream never fires after UIScene migration on iOS

    April 15, 2026

    Grief and the Nonprofessional Programmer – O’Reilly

    April 15, 2026

    AI data center startup Fluidstack in talks for $1B round at $18B valuation months after hitting $7.5B, says report

    April 15, 2026

    Microsoft adds Windows protections for malicious Remote Desktop files

    April 15, 2026
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    flutter – firebase_messaging onMessage stream never fires after UIScene migration on iOS

    April 15, 2026

    Grief and the Nonprofessional Programmer – O’Reilly

    April 15, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.