import UIKit import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { var channelHander : FlutterMethodChannelHandler? override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let controller : FlutterViewController = window?.rootViewController as! FlutterViewController channelHander = FlutterMethodChannelHandler(messenger: controller) GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } }