Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geolocation is skipping location in android after change in still mode to driving/walking mode. #2023

Open
Sarveshwins opened this issue May 16, 2024 · 7 comments

Comments

@Sarveshwins
Copy link

Sarveshwins commented May 16, 2024

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',
},

@christocracy
Copy link
Member

After entering the stationary state, the device must move at least 200 meters before tracking resumes. See api docs Config.stationaryRadius.

@Sarveshwins
Copy link
Author

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.

@Sarveshwins
Copy link
Author

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?

@christocracy
Copy link
Member

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

@Sarveshwins
Copy link
Author

We tested this scenario in couple of devices, Below is the list of devices.

  1. Samsung s21 Ultra.
  2. Samsung F62.
  3. 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.

@christocracy
Copy link
Member

200 meters is not a guarantee. It depends on the device, OS, environment, presence of wifi signals and spacing of cell towers.

@christocracy
Copy link
Member

You are always free to manually engage location tracking from a button on you UI and calling the method .changePace(true).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants