DeferredLocationUpdatesAvailable returns NO in iOS 10

I am trying to use some of the features of CoreLocation and am having problems with pending location updates.

For some reason, when the app was updated for iOS 10, the pending LocationUpdatesAvailable always returns NO. I am testing the iPhone 6, so I know that the device is capable of using GPS functions.

I tried using this for debugging:

[CLLocationManager deferredLocationUpdatesAvailable] 

I canโ€™t understand if this is a problem with iOS 10 or if I have something incorrectly installed.

In this method:

 - (void)locationManager:(CLLocationManager *)manager didFinishDeferredUpdatesWithError:(NSError *)error { self.deferringUpdates = NO; NSLog(@"DEFERRING Error: [%@]", error); if (error) { [[LocationManagerClient alertWithMessage:error.localizedDescription andTitle:error.domain] show]; } } 

As a result, I am logging this error:

 DEFERRING Error: [Error Domain=kCLErrorDomain Code=11 "(null)"] 

Does anyone else encounter this issue with iOS 10 or have an idea of โ€‹โ€‹what's going on?

Edit: This is how I set the distance filter

 - (void)configureForApplicationWillResignActive { [_locationManager setAllowsBackgroundLocationUpdates:YES]; [_locationManager setPausesLocationUpdatesAutomatically:NO]; [_locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [_locationManager setDistanceFilter:kCLDistanceFilterNone]; // use distance filter [_locationManager requestAlwaysAuthorization]; } - (void)configureForApplicationDidBecomeActive { [_locationManager setAllowsBackgroundLocationUpdates:YES]; [_locationManager setPausesLocationUpdatesAutomatically:NO]; [_locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [_locationManager setDistanceFilter:kCLDistanceFilterNone]; // use distance filter [_locationManager requestAlwaysAuthorization]; } 
+9
ios objective-c core-location
Sep 14 '16 at 20:13
source share
3 answers

I have already submitted Radar (28303779) with a proof of concept example code - also contains a wording from the radar. I also opened the dev forum post and it looks like many engineers are facing the same problem. deferredLocationUpdatesAvailable() also returns false in iOS 10. It seems that the apple intentionally disabled functionality.

Update

My bug report closed, saying "it works as intended." I believe that Apple does not intend to fix it, and this was mistakenly accepted without fatigue in the first place.

+3
Sep 29 '16 at 20:02
source share

It seems to me that this is a bug in iOS 10

We all need to file radars to fix this, please seal my: openradar.appspot.com/radar?id=4927958787555328

+1
Sep 26 '16 at 12:34
source share

This seems to be a โ€œmistake." (plays on iOS11 and iOS12, iPhone 7, iPad mini 4 cellular)

CLLocationManager.deferredLocationUpdatesAvailable () always returns false, so the code for deferred updates never runs. However, when the application is in the background and the location manager delivers positions through locationManager (_ manager: CLLocationManager, didUpdateLocations location: [CLLocation]), these positions are delayed as if deferred access were turned on.

I think that the delayed API exists only for compatibility reasons with older applications, and new applications do not need to worry about this at all.

0
Dec 07 '18 at 11:29
source share



All Articles