react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Background location didn't respond if I stops for certain minutes and then moving again
Your Environment
- Plugin version:4.16.3
- Platform: Android
- OS version: Android 12
- Device manufacturer / model:samsung SM-M215F
- React Native version (
react-native -v):0.66.5 - Plugin config
{
// Geolocation Config
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 50,
// Activity Recognition
stopTimeout: 10,
// Application config
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
startOnBoot: true, // <-- Auto start tracking when device is powered-up.
// HTTP / SQLite config
url:{API_URL},
method: 'POST',
foregroundService:true,
extras: data,
autoSync: true,
autoSyncThreshold: 2,
batchSync: true, // <-- [Default: false] Set true to sync locations to server in a single HTTP request.
headers: headerWithCookie,
// params: data
// params: { // <-- Optional HTTP params
// "auth_token": "maybe_your_server_authenticates_via_token_YES?"
// }
}
Expected Behavior
- It should shows me a latlong whenever i am moving in background as well as on foreground as per the cofiguration
- Give consistency in data
Actual Behavior
- It gives me an inconsistent lat long
- Some times it stops if I am still in between the route and then plugin took long time to awake again.
Steps to Reproduce
Debug logs
plugin took long time to awake again.
Define “long time” in terms of distance.
Define “long time” in terms of distance.
It took between 5 to 15 KMs
The plug-in uses a geofence around the last known position in addition to listening to the motion api to determine when the device is moving.
Both these APIs are managed by the OS — when the OS fires and event on one of those APIs, the plug-in acts.
there’s nothing the plug-in can do to make those APIs fire any quicker on some particular device in some particular environment.
I just travelled all around France for over two weeks with iPhone 15 Pro and Pixel 6 using the Demo app linked in the readme.
https://www.transistorsoft.com/lab/france
also see https://dontkillmyapp.com
So, then what can i do in terms of setting in backgroundlocation config to decrease this geofence?
Please help me to get more consistent data in my application.
Hey Chris, I understand we will do more testing with other devices and confirm. [we have been using your plugins since 2016 (cordova, react-native, and recently capacitor), and they have always worked and will continue working for us in the future]
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.