transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
656 stars 277 forks source link

Getting Accuracy more than 100 #1433

Closed toufiqpathan closed 2 months ago

toufiqpathan commented 2 months ago

Your Environment

Plugin version: 4.12.0 Platform:Android OS version: 13 Device manufacturer / model: Google / checking in simulator (sdk_gphone_x86_64) Cordova version (cordova -v): 12.0.0 Cordova platform version (cordova platform ls):android 12.0.0 Plugin config provided to #ready:

Expected Behavior

Actual Behavior

Steps to Reproduce

1. 2. 3. 4.

Context

watchPosition is returning High accuracy more than 100, do we need to anything with the plugin?

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
toufiqpathan commented 2 months ago

Hi @christocracy any update on this

christocracy commented 2 months ago

.watchPosition automatically requests the highest possible accuracy from the native location api.

You're aware that gps only works outdoors, right? While indoors, expect accuracy of 40-100 meters.

christocracy commented 2 months ago

.watchPosition should be avoided. It's designed for short periods while in the foreground. It's not designed for long periods in the background. .watchPosition is not required

toufiqpathan commented 2 months ago

Intested of .watchposition what we have to use to get the current location of the user for every one minute

christocracy commented 2 months ago

You can't have the location every minute (while the device is sitting stationary). .watchPosition is going to empty the user's battery in a few hours and the user is going to uninstall your app.

For periodic location, use background-fetch.

toufiqpathan commented 2 months ago

Ok thanks.

christocracy commented 2 months ago

Imagine the battery drain following a driving route in a Map app for several hours: that's what .watchPosition is going to do.