Do any of you guys experience the same issue that i’ve been experiencing. Here is my code:
let locationManager : CLLocationManager = CLLocationManager()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.allowsBackgroundLocationUpdates = true
locationManager.activityType = CLActivityType.fitness
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.pausesLocationUpdatesAutomatically = false;
locationManager.requestAlwaysAuthorization();
locationManager.startUpdatingLocation()
and in my didUpdateLocations delegate i have this code:
if (CLLocationManager.deferredLocationUpdatesAvailable()) {
let timeInterval: TimeInterval = TimeInterval(60
locationManager.allowDeferredLocationUpdates(untilTraveled: CLLocationDistanceMax, timeout: timeInterval)
}
And this CLLocationManager.deferredLocationUpdatesAvailable() always returns false. I have an iPhone 6plus running iOS 11.0.3.