-
-
Notifications
You must be signed in to change notification settings - Fork 663
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
[Question]: Updating accuracy/distanceFilter while the Position stream is running #1569
Comments
I've attempted to implement this by adding a new function with the following signature: static Future<void> updatePositionStream({
required LocationSettings locationSettings,
}); Full source code: https://github.com/orkun1675/flutter-geolocator Would this approach be something Baseflow is intrested in to contribute back to main? |
This approach is possible because:
[needs source]
I have tested these on emulators and they are WAI. |
When is it expected to be implemented? |
Please see my fork at: https://github.com/orkun1675/flutter-geolocator. You can point your pubspec to it to use it. If Baseflow folks are interested and reply to this bug, I'll clean up the code and open a PR. |
Please check the following before submitting a new issue.
Please select for which platform(s) you need help
Your question
First of all, thank you for the great plugin!
I'm building a navigation app that needs low frequency (high
distanceFilter
andintervalDuration
) location updates at the beginning but higher frequency (lowdistanceFilter
andintervalDuration
) as the user reaches the end of their journey.IIUC iOS recommends adjusting the
desiredAccuracy
anddistancefilter
values to optimize for battery usage. It makes sense that this applies to Android as well.Is there a way to update these values without cancelling and re-creating the Position stream?
Or is there a way to retain the Foreground service even when cancelling and re-creating the stream?
Because otherwise on Android re-creating fails with
android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false
; as applications running in the background cannot create foreground services.I'm happy to contribute a PR if this feature does not exist and you'd be willing to point me in the right direction.
Version
12.0.0
The text was updated successfully, but these errors were encountered: