transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.66k stars 426 forks source link

Background Location Stop Detecting Very Late After Stopped #2068

Closed dev-guardiant closed 5 months ago

dev-guardiant commented 5 months ago

Your Environment

Expected Behavior

The app should trigger a callback from the listener for stationary event once stopped. In the stopTImeout config, it says the no of minutes it should wait inorder to trigger stationary position, i have given the value of one minute for the stopTImeout config option and I have done a few test trips monitoring the adb logs and api calls. The stationary position is always triggered only after 10 minutes.

Actual Behavior

The library is triggering an on stopMotion only after 10 minutes. Is there a way to handle this issue ?

Debug logs

RIght after parking the car

06-25 01:31:05.148 13193 29857 I TSLocationManager: ║ Motion Transition Result

06-25 01:31:05.148 13193 29857 I TSLocationManager: ╠═════════════════════════════════════════════

06-25 01:31:05.148 13193 29857 I TSLocationManager: ╟─ 🎾 ENTER: in_vehicle

06-25 01:31:05.148 13193 29857 I TSLocationManager: ╚═════════════════════════════════════════════

06-25 01:31:05.149 13193 29857 D TSLocationManager: [c.t.l.service.AbstractService a]

06-25 01:31:05.149 13193 29857 D TSLocationManager: ⚙️︎ FINISH [ActivityRecognitionService startId: 2, eventCount: 0, sticky: false]

06-25 01:31:05.359 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService f]

06-25 01:31:05.359 13193 13193 D TSLocationManager: ⚙️︎ ActivityRecognitionService.stopSelfResult(2): true

06-25 01:31:05.361 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService onDestroy]

06-25 01:31:05.361 13193 13193 D TSLocationManager: 🔴 ActivityRecognitionService stopped

06-25 01:31:10.116 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService a]

06-25 01:31:10.116 13193 13193 D TSLocationManager: 🎾 start [TrackingService startId: 156, eventCount: 1]

06-25 01:31:10.120 13193 13193 I TSLocationManager: [c.t.l.service.TrackingService b]

06-25 01:31:10.120 13193 13193 I TSLocationManager: ℹ️ Location availability: false

06-25 01:31:10.122 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService a]

06-25 01:31:10.122 13193 13193 D TSLocationManager: ⚙️︎ FINISH [TrackingService startId: 156, eventCount: 0, sticky: true]

A few minutes after parking (10 minutes approx)

06-25 01:40:39.145 13193 30586 I TSLocationManager: ╔═════════════════════════════════════════════

06-25 01:40:39.145 13193 30586 I TSLocationManager: ║ Motion Transition Result

06-25 01:40:39.145 13193 30586 I TSLocationManager: ╠═════════════════════════════════════════════

06-25 01:40:39.145 13193 30586 I TSLocationManager: ╟─ 🔴 EXIT: in_vehicle

06-25 01:40:39.145 13193 30586 I TSLocationManager: ╟─ 🎾 ENTER: still

06-25 01:40:39.145 13193 30586 I TSLocationManager: ╚═════════════════════════════════════════════

06-25 01:40:39.146 13193 30586 D TSLocationManager: [c.t.l.service.AbstractService a]

06-25 01:40:39.146 13193 30586 D TSLocationManager: ⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false]

06-25 01:40:39.157 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService a]

06-25 01:40:39.157 13193 13193 D TSLocationManager: 🎾 STOP_TIMEOUT [TrackingService startId: 232, eventCount: 1]

06-25 01:40:39.201 13193 13193 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot]

06-25 01:40:39.201 13193 13193 I TSLocationManager: ⏰ Scheduled OneShot: STOP_TIMEOUT in 60000ms (jobID: 2059034116)

06-25 01:40:39.211 13193 13193 I TSLocationManager: [c.t.l.l.TSLocationManager d]

06-25 01:40:39.211 13193 13193 I TSLocationManager: 🔴 Location-services: OFF

06-25 01:40:39.214 13193 13193 I TSLocationManager: [c.t.l.l.TSLocationManager requestLocationUpdates]

06-25 01:40:39.214 13193 13193 I TSLocationManager: 🎾 Location-services: ON

06-25 01:40:39.215 13193 13193 D TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1

06-25 01:40:39.218 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService a]

06-25 01:40:39.218 13193 13193 D TSLocationManager: ⚙️︎ FINISH [TrackingService startId: 232, eventCount: 0, sticky: true]

06-25 01:40:39.351 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService f]

06-25 01:40:39.351 13193 13193 D TSLocationManager: ⚙️︎ ActivityRecognitionService.stopSelfResult(1): true

06-25 01:40:39.352 13193 13193 D TSLocationManager: [c.t.l.service.AbstractService onDestroy]

06-25 01:40:39.352 13193 13193 D TSLocationManager: 🔴 ActivityRecognitionService stopped

christocracy commented 5 months ago

Duplicate #2069