breautek commented on issue #244:
URL: 
https://github.com/apache/cordova-plugin-geolocation/issues/244#issuecomment-1005935636


   > In the error delegate, the plugin call "stopUpdatingLocation". I think 
there is no reason to do that.
   
   I think this is intentional based on Apple's guidelines on [handling 
location 
errors](https://developer.apple.com/documentation/corelocation/cllocationmanagerdelegate/1423786-locationmanager?language=objc).
   
   > If the user denies your app's use of the location service, this method 
reports a kCLErrorDenied error. Upon receiving such an error, you should stop 
the location service.
   
   The code:
   
   
https://github.com/apache/cordova-plugin-geolocation/blob/5957a80f644ac1d8477e501e99f7fa04f64b9a3d/src/ios/CDVLocation.m#L349-L352
   
   follows this suggestion (although a bit too broadly) by stopping the service 
if the error is not an `kCLErrorLocationUnknown` error. The reason for this 
"not kCLErrorLocationUnknown" check is because `kCLErrorLocationUnknown` can 
safely be ignored.
   
   I suspect that you're not receiving `kCLErrorLocationUnknown` here and when 
the app goes into the background, you're actualyl receiving a different error, 
likely 
[kCLErrorDenied](https://developer.apple.com/documentation/corelocation/clerror/kclerrordenied?language=objc)
 because you require special permissions for background location access.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to