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

   > No, lData is not null so the error callback seems to be called with 
PERMISSIONDENIED (=1).
   > 
   > But still it's hard to find out ... I guess we need
   > 
   > * at least to document that (ios quirk : when you receive an error=1, the 
location service is stopped by the plugin so you should restart it when needed)
   > * or you let the responsability to stop the service in the JS side (and 
document it : ios quirk : when you receive an error=1 the apple guideline ask 
you to stop the service)
   > * or add another callback "locationServiceStopped" to simplify the 
handling of the restart.
   > 
   > What do you think ?
   
   Based on 
https://developer.apple.com/documentation/corelocation/cllocationmanagerdelegate/1423786-locationmanager?language=objc
   
   > The location manager calls this method when it encounters an error trying 
to get the location or heading data. If the location service is unable to 
retrieve a location right away, it reports a 
[kCLErrorLocationUnknown](https://developer.apple.com/documentation/corelocation/clerror/kclerrorlocationunknown?language=objc)
 error and keeps trying. In such a situation, you can simply ignore the error 
and wait for a new event. If a heading could not be determined because of 
strong interference from nearby magnetic fields, this method returns 
[kCLErrorHeadingFailure](https://developer.apple.com/documentation/corelocation/clerror/kclerrorheadingfailure?language=objc).
   >
   >If the user denies your app's use of the location service, this method 
reports a 
[kCLErrorDenied](https://developer.apple.com/documentation/corelocation/clerror/kclerrordenied?language=objc)
 error. Upon receiving such an error, you should stop the location service.
   
   I think perhaps we can proceed... If we are stopping location services on 
`kCLErrorLocationUnknown`, then perhaps that logic can be removed, as the apple 
docs states it can be ignored. I think we'd need to pay attention to make sure 
any configured timeouts are properly honoured.
   
   > Duplicate of: 
https://github.com/apache/cordova-plugin-geolocation/issues/224
   I think we fixed this issue with denied pull request. You can try. 
https://github.com/apache/cordova-plugin-geolocation/pull/225
   
   I don't think this is a duplicate because #224 is subjected around 
`kCLErrorDenied` and Apple explicitly states that the application should stop 
location services on this error code, so I believe the geolocation plugin 
behaviour in this case is intentional. This issue is in regards of 
`kCLErrorLocationUnknown`.
   
   In either case, listening on the `resume` event and calling `watchPosition` 
again should be a sufficient workaround.


-- 
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