I want my app to update location continuous in background. I have implemented below code.
locationManager.pausesLocationUpdatesAutomatically =false
self.locationManager = CLLocationManager()
locationManager.requestWhenInUseAuthorization()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation
locationManager.allowsBackgroundLocationUpdates=true
locationManager.startMonitoringSignificantLocationChanges()
self.locationManager.startUpdatingLocation()
- This code manage in
appdelegate
didFinishLaunchingWithOptions()