import UIKit
import AVFoundation
import Flutter
import GoogleMaps

@available(iOS 13.0.0, *)
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("AIzaSyBzO3vZEUzptCvUc2rNi1Gfy5HnqTjg3gM")
    if #available(iOS 10.0, *) {
      UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
    }

//      let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
      weak var registrar = self.registrar(forPlugin: "my-views")
      let cealQrViewfactory = CameraViewFactory(messenger: registrar!.messenger())
      let viewRegistrar = self.registrar(forPlugin: "<my-views>")!
      viewRegistrar.register(cealQrViewfactory, withId: Constants.viewType)

    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
