-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Location update are disabled after one kCLErrorLocationUnknown #244
Comments
I think this is intentional based on Apple's guidelines on handling location errors.
The code: cordova-plugin-geolocation/src/ios/CDVLocation.m Lines 349 to 352 in 5957a80
follows this suggestion (although a bit too broadly) by stopping the service if the error is not an I suspect that you're not receiving |
Yes ok, that is a kCLErrorDenied. The problem is the JS side is not notified in this very case (the request has been stoped because background). Maybe we should pass something special to the error callback or add another specific callback (locationRequestStopped?). Thank you. |
Is this not already covered via?: cordova-plugin-geolocation/src/ios/CDVLocation.m Lines 336 to 347 in 5957a80
or is |
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
What do you think ? |
I think perhaps we can proceed... If we are stopping location services on
I don't think this is a duplicate because #224 is subjected around In either case, listening on the |
Bug Report
Problem
On iOS, start requesting location updates. You reveive locations updates. Ok.
Put the app in background and make the phone in sleep mode (press the right button).
The app receive still some updates then an error is triggered. That is normal.
What is expected to happen?
When I wake up the phone and the app in foreground, I expect to be notified again with locations updates.
What does actually happen?
When you restart the app, no more updates.
In the error delegate, the plugin call "stopUpdatingLocation". I think there is no reason to do that.
Information
Command or Code
In locationManager:didFailWithError:
This code should be removed
if (error.code != kCLErrorLocationUnknown) { [self.locationManager stopUpdatingLocation]; __locationStarted = NO; }
Environment, Platform, Device
Tested on iPhone 13 mini iOS 15.1.1
The text was updated successfully, but these errors were encountered: