react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Geolocation is skipping location in android after change in still mode to driving/walking mode.
We are facing issue for android platform of skipping location, Library stop pushing data on backend after some time interval. Example: If we are in still mode from last 7-8 hours and after that we start walking then we are not getting data on backend but after couple of minutes we are getting our data but it's only providing last location and all previous data is missed.
Our configurations are mentioned below, Please help us to resolve this issue.
await BackgroundGeolocation.ready({ url: API_URL + API_ENDPOINTS.SAVELOCATION, logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: 10, stopTimeout: 5, autoSync: true, batchSync: true, disableProviderChangeRecord: true, autoSyncThreshold: 5, maxBatchSize: 10, stopOnTerminate: false, startOnBoot: true, enableHeadless: true, maxDaysToPersist: 3, logMaxDays: 5, locationAuthorizationRequest: 'Always', locationTemplate: '{"Latitude":<%= latitude %>,"Longitude":<%= longitude %>,"TimeStamp": "<%= timestamp %>","Uuid": "<%= uuid %>","Event": "<%= event %>","IsMoving": <%= is_moving %>,"Age":<%= age %>,"Speed":<%= speed %>,"Odometer":<%= odometer %>,"Mock":<%= mock %>,"Activity": "<%= activity.type %>","Activityconfidence": "<%= activity.confidence %>","Accuracy": <%= accuracy %>,"AltitudeAccuracy": <%= altitude_accuracy %>,"Altitude": <%= altitude %>,"Heading": <%= heading %>,"Level": <%= battery.level %>,"IsCharging": <%= battery.is_charging %>}', backgroundPermissionRationale: { title: "Allow {applicationName} to access this device's location even when closed or not in use.", message: 'This app collects location data to enable recording your trips to work and calculate distance-travelled.', positiveAction: 'Change to "{backgroundPermissionOptionLabel}"', negativeAction: 'Cancel', },
After entering the stationary state, the device must move at least 200 meters before tracking resumes. See api docs Config.stationaryRadius.
We tested the scenario again now after 7-8 hours of still mode we start walking and we got our first entry after covering distance of 1KM approx. So the major issue which we are facing is that we are not getting entries after 200 meters but we are getting entries after covering distance of around 1 km, Can you please suggest some changes or fixes so we can wrap this up. Note: This issue only occurs when the device is in still mode for couple of hours.
We tested the scenario again now after 7-8 hours of still mode we start walking and we got our first entry after covering distance of 1KM approx. So the major issue which we are facing is that we are not getting entries after 200 meters but we are getting entries after covering distance of around 1 km, Can you please suggest some changes or fixes so we can wrap this up. Note: This issue only occurs when the device is in still mode for couple of hours.
@christocracy any update?
Can you please suggest some changes or fixes
The plug-in is at the mercy of the particular device and OS you’re using (you didn’t specify). Some devices are worse than others (particularly Chinese devices). A Google Pixel device, where the Android APIs operate as documented, requires about 200 meters of movement for tracking to engage and are not affected by “sitting idle for several hours”.
see https://dontkillmyapp.com
We tested this scenario in couple of devices, Below is the list of devices.
- Samsung s21 Ultra.
- Samsung F62.
- Realme 9 pro.
In these all devices we are not getting callback after 200 meters of movement, Infact it's giving us entries after covering distance of 1KM approx.
200 meters is not a guarantee. It depends on the device, OS, environment, presence of wifi signals and spacing of cell towers.
You are always free to manually engage location tracking from a button on you UI and calling the method .changePace(true).
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.