import UIKit
import Flutter

@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
      navigateToSpecialPage()
      let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
      let channel = FlutterMethodChannel(name: "channel_name", binaryMessenger: controller.binaryMessenger)
      channel.setMethodCallHandler({ (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
          if let url = URL(string: "my://") {
              UIApplication.shared.open(url, options: [:], completionHandler: nil)
          }
          if (call.method == "getPlatformVersion") {
          result(UIDevice.current.systemVersion)
        } else {
          result(FlutterMethodNotImplemented)
        }
      })
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
    
    
    
    func navigateToSpecialPage() {
        print("11111111111111111111")
    }
}
