AppDelegate.swift 1013 Bytes
import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    let controller = self.window.rootViewController as! FlutterViewController
       let channel = FlutterMethodChannel.init(name: "com.naji/book", binaryMessenger: controller as! FlutterBinaryMessenger)
       channel.setMethodCallHandler { (call, result) in
           if call.method == "getIntent" {
              //  let para = call.arguments
              //  print(para!)
            let userInfo = launchOptions?[UIApplication.LaunchOptionsKey.remoteNotification];
               
            result(userInfo);
           }else{
               result(FlutterMethodNotImplemented)
           }
       }
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}