-
-
Notifications
You must be signed in to change notification settings - Fork 691
[Feature] Throw LocationSignalLostException when GPS signal is lost #1617
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
base: main
Are you sure you want to change the base?
Conversation
This feature requires changes in 4 plugins. I'm not sure how I can get the static analyzers to pass due to this inter-dependency. Any guidence would be appreciated. Note that IIUC, once this PR is merged and updates to the 4 plugins are published to pub.dev the build errors will go away. |
Dear @orkun1675, Thanks for the contribution. Do you want to update this PR? I'm planning to pick it up and test how it works. I do however have a question regarding your PR. It looks like you throw the exception on Android and iOS when the location signal is lost. on iOS: https://developer.apple.com/documentation/corelocation/clerror-swift.struct/code/locationunknown?language=objc Both seem to be able to recover from this state (when something changes). But, it is not always because of the GPS location. The location could also be fetched from other sources right? If so, we should make a clear distinction between GPS and Location. Because a GPS location is always a location but a location is not always a GPS location. Furthermore, regarding your question: The approach would be the following: First we can use this PR for "ALL" changes required. Then we can test the changes and we could split the PR into different PR's for the separate packages (android, iOS and so on). Then we start releasing the packages first. After that we release the platform interface. And then the app facing package. If all packages are released we are done. Kind regards, |
Hi @TimHoogstrate I tested this PR in production but the OS (especially iOS) does not behave as expected. When my iPhone SE goes underground the location updates keep coming in for a few minutes and We thus gave up on trying to differentiate between no GPS vs. no movement for iOS. This change is still useful for the Android side, IIRC. I unfortunately don't have the bandwidth to pick this back up right now, but it would make sense IMO, to merge it and add a disclaimer about unpredictable iOS behaviour. |
Thanks for your reply, nice finding. Let's keep this PR open for now and maybe we can use it sometime later when we better understand what is happening at iOS devices. Kind regards, |
When the GPS signal is lost while listening for position updates we inform the listener using an exception called
LocationSignalLostException
. This allows listeners to be aware of position availability changes. The listener can catch and ignore this exception if it is not important to them. The listener knows the GPS signal is restored when they receive a newPosition
via the stream.Fixes #1355.
Pre-launch Checklist
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.CHANGELOG.md
to add a description of the change.///
).main
.dart format .
and committed any changes.flutter analyze
and fixed any errors.