I don't want to store my locations, just use the position on moment. My config:
BackgroundGeolocation.configure({
desiredAccuracy: 10,
stationaryRadius: 50,
distanceFilter: 50,
locationTimeout: 30,
debug: false,
startOnBoot: false,
stopOnTerminate: true,
locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER,
interval: 30000,
fastestInterval: 15000,
activitiesInterval: 10000,
stopOnStillActivity: false,
maxLocations: 1,
startForeground: false,
});
And getLocations gives me:
(96) [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
EDIT
"react": "^16.0.0",
"react-native": "^0.50.3",
"react-native-mauron85-background-geolocation": "^0.4.0-alpha.6",
Thank you for pointing out. Apparently maxLocations are not mapped in
https://github.com/mauron85/react-native-background-geolocation/blob/master/android/lib/src/main/java/com/marianhello/react/ConfigMapper.java#L18
Will fix
Fixed in 0.4.0-rc.2
Thank you!
Most helpful comment
Thank you for pointing out. Apparently maxLocations are not mapped in
https://github.com/mauron85/react-native-background-geolocation/blob/master/android/lib/src/main/java/com/marianhello/react/ConfigMapper.java#L18
Will fix