Baseflow / Baseflow/flutter-geolocator
[Bug]: Diffierent `distanceFilter` behavior between iOS and Android
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
### Please check the following before submitting a new issue.
- [x] I have searched the [existing issues](https://github.com/baseflow/flutter-geolocator/issues).
- [x] I have carefully [read the documentation](https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator/README.md) and verified I have added the required platform specific configuration.
### Please select affected platform(s)
- [x] Android
- [x] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [ ] Windows
### Steps to reproduce
Listen to location update with the default `distanceFilter` (i.e. 0)
Do not move the device (so the gpx coordinates doesn't change). You either need very good gps singnal or just use a simulator and set the location to a fix point.
### Expected results
On both devices, we should be able to get continuous location updates.
### Actual results
Only get this on Android, and on iOS you only get the first update.
I believe on iOS, distanceFilter = 0 actually means filtering out fix points.
Passing distanceFilter = -1 to iOS will get the same beahvior as Andorid with distanceFilter = 0.
Also one cannot pass distanceFilter = -1 on android becuase it will raise.
### Code sample
Just using the example and set the `distanceFilter`.
### Screenshots or video
_No response_
### Version
14.0.2
### Flutter Doctor output
Doctor output
I don't think this is related.
Contributor guide
Research direction
Start with the example that sets distanceFilter and trace how location updates are implemented separately for Android and iOS. Reproduce the behavior with a fixed simulator location and compare distanceFilter values of 0 and -1 on both platforms. Done means the documented default produces consistent continuous updates without an invalid value on either platform.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart, ios
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100