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
655 stars 277 forks source link

Demo Cordova BG Geo App location tracking and odometer Issues #1386

Closed tushaagit closed 1 year ago

tushaagit commented 1 year ago

Your Environment


## Expected Behavior
App should Track as per the set 100 meter distance filter from start location to end location. Also odometer capture 
## Actual Behavior
App location capturing stops in between for nearly 9-10 kms and then suddenly starts capturing again (Note: App not opened in between the journey, neither done changes in setting manually throughout the journey). Please observe the attached log and transistor soft link https://tracker.transistorsoft.com/tushar_xecomit from "timestamp": "2023-02-08T14:35:20.001Z" to  "timestamp": "2023-02-08T14:46:08.553Z", for date 08/02/2023.   (OR IST 20:5 to 20:16  08-02-2023)

## Steps to Reproduce
<!--- reproduce this issue; include code to reproduce, if relevant -->
1. Start The BG Geo service using the settings provided
2. Change the distance filter to 100 meter
3. Start moving on vehicle
4. Once user arrive at the destination, stop the Bg Geo service.

## Context
Trying to simulate the issues on Cordova BG Geo demo App, issues found are similar to what we are facing on day to day basis after integrating the BG Geo plugin  

## Debug logs
<!-- include iOS / Android logs
- ios XCode logs,
- use #getLog #emailLog methods (@see docs)
- Android: $ adb logcat
-->
<details>
    <summary>Logs</summary>

```<!-- Syntax highlighting:  DO NOT REMOVE -->
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════

02-08 20:04:27.512 DEBUG [TSLocationManager onLocationResult] 
  ℹ️  IGNORED: same as last location
02-08 20:04:27.542 DEBUG [AbstractService start] 
  🎾  BackgroundTaskService [eventCount: 1]
02-08 20:04:27.543 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 2
02-08 20:04:27.567 DEBUG [b first] 
  ✅  Locked 1 records
02-08 20:04:27.568 INFO [HttpService a] 
  🔵  HTTP POST: e6a08bc1-23a5-4e66-b82f-62561cb4e90d
02-08 20:04:27.984 INFO [HttpService$h onResponse] 
  🔵  Response: 200
02-08 20:04:27.986 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] 💀  event (CUSTOM IMPLEMENTATION): http
02-08 20:04:27.987 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] - event: com.transistorsoft.locationmanager.http.HttpResponse@1d4a836
02-08 20:04:27.987 DEBUG [b destroy] 
  ✅  DESTROY: e6a08bc1-23a5-4e66-b82f-62561cb4e90d
02-08 20:04:28.000 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 2
02-08 20:04:28.003 DEBUG [AbstractService finish] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
02-08 20:04:28.008 DEBUG [AbstractService onDestroy] 
  🔴  BackgroundTaskService stopped
02-08 20:05:18.846 INFO [ScheduleEvent onOneShot] 
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: STOP_TIMEOUT
╠═════════════════════════════════════════════

02-08 20:05:18.867 DEBUG [TSConfig d] ℹ️   Persist config, dirty: [isMoving]
02-08 20:05:18.875 INFO [HeartbeatService stop] 
  🔴  Stop heartbeat
02-08 20:05:18.879 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
02-08 20:05:18.880 INFO [TSLocationManager removeLocationUpdates] 
  🔴  Location-services: OFF
02-08 20:05:18.885 INFO [TrackingService changePace] 
  🔵  setPace: true → false
02-08 20:05:18.916 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
02-08 20:05:18.917 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 1, requestId: 2]
02-08 20:05:18.920 INFO [ActivityRecognitionService start] 
  🎾  Start motion-activity updates
02-08 20:05:18.922 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
02-08 20:05:20.103 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
02-08 20:05:20.105 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ motionchange LocationResult: 2
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 18.517450,73.768712 hAcc=10.376 et=+9d9h27m31s411ms alt=549.800048828125 vAcc=8.259759 vel=6.4385066 sAcc=0.7224957 bear=3.099989 bAcc=5.0828295 {Bundle[{}]}], age: 103ms, time: 1675866920001

02-08 20:05:20.111 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired motionchange position, isMoving: false
02-08 20:05:20.112 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 72.826
02-08 20:05:20.113 DEBUG [TSLocationManager incrementOdometer] Odometer: 353.04602
02-08 20:05:20.125 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
02-08 20:05:20.137 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] 💀  event (CUSTOM IMPLEMENTATION): location
02-08 20:05:20.137 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] - event: com.transistorsoft.locationmanager.location.TSLocation@a343428
02-08 20:05:20.138 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] 💀  event (CUSTOM IMPLEMENTATION): motionchange
02-08 20:05:20.138 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] - event: com.transistorsoft.locationmanager.event.MotionChangeEvent@f0e9541
02-08 20:05:20.138 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
02-08 20:05:20.183 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 2 isFinished? true
02-08 20:05:20.184 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
02-08 20:05:20.186 DEBUG [TSGeofenceManager startMonitoringStationaryRegion] 
  🎾  Start monitoring stationary region (radius: 150.0m 18.5174503,73.7687121 hAcc=10.376)
02-08 20:05:20.187 INFO [b persist] 
  ✅  INSERT: 554616ce-0806-4799-a9f2-197688961aa9
02-08 20:05:20.189 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════

02-08 20:05:20.222 DEBUG [AbstractService start] 
  🎾  BackgroundTaskService [eventCount: 1]
02-08 20:05:20.223 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 3
02-08 20:05:20.231 DEBUG [AbstractService start] 
  🎾  TrackingService [eventCount: 1]
02-08 20:05:20.233 INFO [TrackingService handleMotionChangeResult] 
╔═════════════════════════════════════════════
║ TrackingService motionchange: false
╠═════════════════════════════════════════════

02-08 20:05:20.239 DEBUG [AbstractService finish] ⚙️︎  finish TrackingService [eventCount: 0, sticky: false]
02-08 20:05:20.244 DEBUG [b first] 
  ✅  Locked 1 records
02-08 20:05:20.244 INFO [HttpService a] 
  🔵  HTTP POST: 554616ce-0806-4799-a9f2-197688961aa9
02-08 20:05:20.498 DEBUG [AbstractService onDestroy] 
  🔴  TrackingService stopped
02-08 20:05:20.865 INFO [HttpService$h onResponse] 
  🔵  Response: 200
02-08 20:05:20.866 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] 💀  event (CUSTOM IMPLEMENTATION): http
02-08 20:05:20.867 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] - event: com.transistorsoft.locationmanager.http.HttpResponse@2e35fc3
02-08 20:05:20.867 DEBUG [b destroy] 
  ✅  DESTROY: 554616ce-0806-4799-a9f2-197688961aa9
02-08 20:05:20.877 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 3
02-08 20:05:20.878 DEBUG [AbstractService finish] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
02-08 20:05:20.883 DEBUG [AbstractService onDestroy] 
  🔴  BackgroundTaskService stopped
02-08 20:16:08.461 DEBUG [AbstractService start] 
  🎾  GeofencingService [eventCount: 1]
02-08 20:16:08.467 DEBUG [TSConfig d] ℹ️   Persist config, dirty: [isMoving]
02-08 20:16:08.470 INFO [HeartbeatService stop] 
  🔴  Stop heartbeat
02-08 20:16:08.471 DEBUG [TSGeofenceManager stopMonitoringStationaryRegion] 
  🔴  Stop monitoring stationary region
02-08 20:16:08.491 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
02-08 20:16:08.491 INFO [TrackingService changePace] 
  🔵  setPace: false → true
02-08 20:16:08.511 DEBUG [AbstractService start] 
  🎾  TrackingService [eventCount: 1]
02-08 20:16:08.512 INFO [TrackingService handleMotionChangeResult] 
╔═════════════════════════════════════════════
║ TrackingService motionchange: true
╠═════════════════════════════════════════════

02-08 20:16:08.512 DEBUG [AbstractService finish] ⚙️︎  finish TrackingService [eventCount: 0, sticky: true]
02-08 20:16:08.532 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
02-08 20:16:08.534 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 1, requestId: 3]
02-08 20:16:08.536 INFO [ActivityRecognitionService start] 
  🎾  Start motion-activity updates
02-08 20:16:08.538 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
02-08 20:16:08.545 INFO [GeofencingService handleStationaryGeofenceExit] 
╔═════════════════════════════════════════════
║ GeofencingService: Stationary geofence EXIT
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 18.594739,73.758080 hAcc=122.4 et=+9d9h38m17s875ms alt=493.1000061035156 vAcc=30.565102]

02-08 20:16:08.545 DEBUG [AbstractService finish] ⚙️︎  finish GeofencingService [eventCount: 0, sticky: false]
02-08 20:16:09.057 DEBUG [AbstractService onDestroy] 
  🔴  GeofencingService stopped
02-08 20:16:09.996 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
02-08 20:16:09.999 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ motionchange LocationResult: 3
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 18.595646,73.755829 hAcc=32.504 et=+9d9h38m19s963ms alt=519.2000122070312 vAcc=27.345264 {Bundle[{}]}], age: 1445ms, time: 1675867568553

02-08 20:16:10.040 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 52.665
02-08 20:16:10.041 DEBUG [TSLocationManager incrementOdometer] Odometer: 9114.469
02-08 20:16:10.068 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 3 isFinished? false
02-08 20:16:10.068 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] 💀  event (CUSTOM IMPLEMENTATION): location
02-08 20:16:10.068 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
02-08 20:16:10.068 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] - event: com.transistorsoft.locationmanager.location.TSLocation@838a40f
02-08 20:16:11.038 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
02-08 20:16:11.040 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ motionchange LocationResult: 3
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 18.595642,73.755820 hAcc=146.196 et=+9d9h38m22s353ms alt=519.2000122070312 vAcc=27.36917 vel=0.04673274 sAcc=3.4498985 {Bundle[{}]}], age: 96ms, time: 1675867570942

02-08 20:16:11.088 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 2]
02-08 20:16:11.090 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ motionchange LocationResult: 3
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 18.595639,73.755814 hAcc=146.196 et=+9d9h38m22s421ms alt=519.2000122070312 vAcc=27.369846 vel=0.08718578 sAcc=3.4498985 {Bundle[{}]}], age: 78ms, time: 1675867571011

02-08 20:16:11.095 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 72.826
02-08 20:16:11.100 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 3 isFinished? false
02-08 20:16:11.101 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 1, sticky: true]
02-08 20:16:11.106 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] 💀  event (CUSTOM IMPLEMENTATION): location
02-08 20:16:11.106 DEBUG [BackgroundGeolocationHeadlessTask onHeadlessTask] - event: com.transistorsoft.locationmanager.location.TSLocation@3bce688
02-08 20:16:11.112 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired motionchange position, isMoving: true
02-08 20:16:11.117 INFO [TSLocationManager requestLocationUpdates] 
  🎾  Location-services: ON
02-08 20:16:11.118 DEBUG [TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): 0
02-08 20:16:11.120 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 3 isFinished? true
02-08 20:16:11.120 INFO [ActivityRecognitionService start] 
  🎾  Start motion-activity updates
02-08 20:16:11.121 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
02-08 20:16:11.122 INFO [b persist] 
  ✅  INSERT: b8ec5485-275b-4e22-a0bf-59305c1e2e8b
02-08 20:16:11.122 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
02-08 20:16:11.126 INFO [HttpService flush] 

christocracy commented 1 year ago

I test the demo regularly on the following devices:

the demo is what I use to develop this plugin. I am field testing it daily. Any problems you have are related to https://dontkillmyapp.com