apache / apache/cordova-plugin-geolocation
[iOS] Location update are disabled after one kCLErrorLocationUnknown
- Dominant language
- JavaScript
- Stars
- 646
- Forks
- 654
- PR merge metrics
- No merged PRs in 30d
Description
# 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
Contributor guide
Research direction
Start at the iOS Objective-C locationManager:didFailWithError: delegate and inspect the shown stopUpdatingLocation branch. Reproduce the sleep/wake scenario on the stated iPhone and iOS setup, then verify that location updates resume after kCLErrorLocationUnknown while other failures retain their intended handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, objective-c
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100