react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Background location didn't respond if I stops for certain minutes and then moving again

Open aniappgambit opened this issue 1 year ago • 5 comments

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

background-geolocation.2.log

aniappgambit avatar Aug 06 '24 11:08 aniappgambit

plugin took long time to awake again.

Define “long time” in terms of distance.

christocracy avatar Aug 06 '24 14:08 christocracy

Define “long time” in terms of distance.

It took between 5 to 15 KMs

aniappgambit avatar Aug 06 '24 16:08 aniappgambit

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

christocracy avatar Aug 06 '24 16:08 christocracy

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.

aniappgambit avatar Aug 07 '24 05:08 aniappgambit

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]

dhavaln avatar Aug 07 '24 07:08 dhavaln

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 07 '24 01:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 21 '24 02:09 github-actions[bot]