You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/ios/Runner/AppDelegate.swift

48 lines
1.5 KiB
Swift

4 years ago
import UIKit
import Flutter
4 years ago
import GoogleMaps
4 years ago
4 years ago
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
let locationManager = CLLocationManager()
4 years ago
override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// initLocationManager()
4 years ago
GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8")
GeneratedPluginRegistrant.register(with: self)
if let mainViewController = window.rootViewController as? MainFlutterVC{
HMGPlatformBridge.initialize(flutterViewController: mainViewController)
}
4 years ago
if let _ = launchOptions?[.location] {
HMG_Geofence.initGeofencing()
4 years ago
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
4 years ago
}
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 {
}
}
}