ios – No windows have a root view controller, cannot save application state

0
32

[ad_1]

When ever I try to open the application by clicking the notification this No windows have a root view controller, cannot save application state error is showing and it’s not navigating to the correct page. the app just opens that all.

How should I solve this ?

AppleDelegate:

import UIKit
import Flutter
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        if #available(iOS 10.0, *) {
          UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
        }
        GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
    
    override func application(_ application: UIApplication, shouldSaveSecureApplicationState coder: NSCoder) -> Bool {
            return true
        }
    
    override func application(_ application: UIApplication, shouldRestoreSecureApplicationState coder: NSCoder) -> Bool {
        return true
    }
    
    override func applicationDidBecomeActive(_ application: UIApplication) {
            signal(SIGPIPE, SIG_IGN);
        }

    override func applicationWillEnterForeground(_ application: UIApplication) {
            signal(SIGPIPE, SIG_IGN);
        }
    
     override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
       Messaging.messaging().apnsToken = deviceToken
       return super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
  }
}

[ad_2]