flutter_background_geolocation
flutter_background_geolocation copied to clipboard
I'm getting more than 3 location updates
I have the following issue.
so when I enable the updates (BackgroundGeolocation.start()) I receive 3 or more location data from the location callback
Your Environment
- Plugin version: 4.8.7
- Platform: Android
- OS version:
- Device manufacturer / model:
- Flutter info (
flutter doctor): - Plugin config:
bg.BackgroundGeolocation.ready(
bg.Config(
reset: true,
desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
distanceFilter: 0,
locationUpdateInterval: 10000,
stopOnTerminate: true,
startOnBoot: true,
debug: false,
allowIdenticalLocations: true,
logLevel: bg.Config.LOG_LEVEL_VERBOSE,
locationAuthorizationRequest: 'Always',
backgroundPermissionRationale: bg.PermissionRationale(
title:
"Permitir a {applicationName} acceder a la ubicación de este dispositivo, incluso cuando la app esté en segundo plano.",
message:
"{applicationName} recopila datos de ubicación para habilitar la asignación autómatica de pedidos, soporte en ruta y el registro de entrega de pedidos incluso cuando la aplicación está en segundo plano.",
positiveAction: 'Cambiar a "{backgroundPermissionOptionLabel}"',
negativeAction: 'Cancelar',
),
),
).then((bg.State state) {
_enabled = state.enabled;
_isMoving = state.isMoving ?? false;
});
Expected Behavior
I just want to receive one update no more.
Actual Behavior
I'm receiving more location updates
Steps to Reproduce
- use bg.BackgroundGeolocation.start() then
- bg.BackgroundGeolocation.stop()
- bg.BackgroundGeolocation.start()
Context
Debug logs
Logs
PASTE_YOUR_LOGS_HERE
2 updates at the same time
That’s not at all unusual.
the plug-in doesn’t just request one location when you call .start(), the plug-in will “sample” up to 5 locations. See api docs Location.sample.
the final location settled upon is fired to the onMotionChange event (see api docs).