import Flutter
import UIKit
import FirebaseCore
import FirebaseMessaging
import GoogleMaps
@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng")
    FirebaseApp.configure()
    initializePlatformChannels()
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
    func initializePlatformChannels(){
       if let mainViewController = window?.rootViewController as? FlutterViewController{ // platform initialization suppose to be in foreground
               HMGPenguinInPlatformBridge.initialize(flutterViewController: mainViewController)
           }
        }
    override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken:Data){
//           Messaging.messaging().apnsToken = deviceToken
          super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
      }
}
