katzlbt opened a new issue #224: URL: https://github.com/apache/cordova-plugin-geolocation/issues/224
# Bug Report In iOS 14 watchPosition stops working as soon as the Application is suspended and reactivated. This is probably due to a new(?) iOS behavior of sending error.code == kCLErrorDenied when the app is suspended and has "in use GPS permissions". The documentation (https://cordova.apache.org/docs/en/10.x/reference/cordova-plugin-geolocation/#geolocationoptions) states that: > Note that when used in conjunction with geolocation.watchPosition, the geolocationError callback could be called on an interval every timeout milliseconds! ## Problem A few seconds after being suspeded(!) the debugger stops in the function (https://github.com/apache/cordova-plugin-geolocation/blob/master/src/ios/CDVLocation.m#L343-L352): ``` - (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error error.code == kCLErrorDenied an this generates positionError = PERMISSIONDENIED ``` **... and then stops the watch ...** ``` if (error.code != kCLErrorLocationUnknown) { [self.locationManager stopUpdatingLocation]; __locationStarted = NO; } ``` After reactivation of the app my code gets a GPS Timeout! Code: 3 ### What is expected to happen? GPS watchPosition should probably continue working after the app was suspended. The timeout should fire repeatedly as stated in the documentation. ### What does actually happen? watchLocation stops with a TIMEOUT ### Environment, Platform, Device iOS 14.4.2, newest XCode ### Version information 10.0.0 -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
