import UIKit import Flutter import GoogleMaps @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { let locationManager = CLLocationManager() override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // initLocationManager() GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GeneratedPluginRegistrant.register(with: self) if let mainViewController = window.rootViewController as? MainFlutterVC{ HMGPlatformBridge.initialize(flutterViewController: mainViewController) } if let _ = launchOptions?[.location] { HMG_Geofence.initGeofencing() } return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } extension AppDelegate: CLLocationManagerDelegate { func initLocationManager(){ locationManager.allowsBackgroundLocationUpdates = true locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters locationManager.activityType = .other locationManager.delegate = self locationManager.requestAlwaysAuthorization() } func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) { if region is CLCircularRegion { } } func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) { if region is CLCircularRegion { } } }