flutter-geolocator
flutter-geolocator copied to clipboard
LocationAccuracyStatus.reduced with getCurrentPosition
Hi,
On iOS 15.4 I check that I can't get getCurrentPosition(desiredAccuracy: LocationAccuracy.high) or getCurrentPosition(desiredAccuracy: LocationAccuracy.best) when getLocationAccuracy() is reduced, so the library doesn't manage that automatically and I need a ternary for that.
is this correct? I don't see this in readme/docs, I think you can add a column to the accuraccy table in the readme, similar to this:
Location accuracy
The table below outlines the accuracy options per platform:
| Android | iOS | Accuracy Status | |
|---|---|---|---|
| lowest | 500m | 3000m | all |
| low | 500m | 1000m | all |
| medium | 100 - 500m | 100m | all |
| high | 0 - 100m | 10m | require precice |
| best | 0 - 100m | ~0m | require precice |
| bestForNavigation | 0 - 100m | Optimized for navigation | require precice |
Hey @hectorAguero, thanks for reporting your issue. I think using a ternary statement is the best solution in this case. The CLLocationAccuracy.reduced most of the times preserves the city you're living in, so the returned location can also be 20km from your actual position. So in fact, when using the LocationAccuracy parameter you always need precise positioning.
If you've other suggestions, please let me know.
Thanks, @florissmit1 ,
It would be helpful if the readme recommend the use of ternary for that case, or at least mention the required accuracy, with the column Accuracy Status that I let above.
Hi @hectorAguero,
I know this is an old issue but I wanted to elaborate. It is still possible to request location using the getCurrentPosition(desiredAccuracy: LocationAccuracy.high) and getCurrentPosition(desiredAccuracy: LocationAccuracy.best) when the getLocationAccuracy() is set to reduced by the user.
The geolocator will still return a position, however Apple on purposely made the location less accurate. So positions are still returned just not as accurate as mentioned in the table above. So there is no need for a ternary statement, which is why we also didn't build it into the plugin.
Note that we removed the table with mentioned ranges as they are no longer guaranteed (Apple and Google also no longer make any claims on accuracy).