Showing posts from December, 2023

[SOLVED] Firebase APNS Token not set Flutter iOS

 If you're facing issue with Firebase initialization in Flutter in spite of doing everything right. You may be missing setting the APNS token in app delegate file in xCode. You may use the following code which sets it for you and fixes Firebase init error. import UIKit import Flutter import Firebase import FirebaseMessaging @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate {   override func application(     _ application: UIApplication,     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?   ) -> Bool {              print("fb tokennnnnn: ")         FirebaseApp.configure()     GeneratedPluginRegistrant.register(with: self)     return super.application(application, didFinishLaunchingWithOptions: launchOptions)   }   override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {           Messaging.messaging().apnsToken = deviceToken    print("X__APNS: \(Stri