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.62k stars 428 forks source link

onEnabled and onGeofence not triggering on production but does work on development #2074

Open TNAJanssen opened 2 months ago

TNAJanssen commented 2 months ago

Your Environment

Expected Behavior

OnEnabled and onGeofence are called

Actual Behavior

OnEnabled and onGeofence are not called on iOS with a preview and production build, but the debug notifications are triggered. On a older iPhone it seems to work, but on 2 iPhone 15 Pro Max phones it doesn't work.

Steps to Reproduce

  1. Trigger .ready
  2. add BackgroundGeolocation.onEnabledChange listener
  3. Trigger .start
  4. Trigger changePace with true
  5. Expect onEnabledChange function to be triggered

Context

Send a notification when the onEnabledChange is called with enabled true. It works perfectly on Android and on my development build.

Debug logs

Logs ``` 2024-06-27 17:20:10.315 ℹ️-[TSConfig persist] 2024-06-27 17:20:21.934 ℹ️-[TSConfig persist] 2024-06-27 17:20:22.141 ℹ️-[TSConfig persist] 2024-06-27 17:20:23.620 ℹ️-[TSConfig persist] 2024-06-27 17:20:23.683 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 17:20:23.913 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation stopObserving] 2024-06-27 17:20:23.913 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 17:20:29.092 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 4 2024-06-27 17:20:29.093 🔵-[PolygonGeofencingService locationManager:didChangeAuthorizationStatus:] 4 2024-06-27 17:20:29.093 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 4 2024-06-27 17:20:29.094 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 4 2024-06-27 17:20:29.095 ℹ️-[TSConfig persist] 2024-06-27 17:20:29.096 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 4 2024-06-27 17:20:29.102 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 4 2024-06-27 17:20:30.849 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:20:30.858 🔵-[PolygonGeofencingService locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:20:30.858 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:20:30.858 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:20:30.858 ℹ️-[TSConfig persist] 2024-06-27 17:20:30.859 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3 2024-06-27 17:20:30.862 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:20:34.735 ℹ️-[GeofenceDAO destroyAll]_block_invoke 2024-06-27 17:20:34.735 🔴-[PolygonGeofencingService stop] 2024-06-27 17:20:34.735 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 17:20:34.735 🔵-[TSLocationManager addGeofences:success:failure:] 2024-06-27 17:20:34.736 ℹ️-[GeofenceDAO doInsert:geofence:] no-event-id-tenant 2024-06-27 17:20:34.736 ℹ️-[GeofenceDAO doInsert:geofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:20:34.775 ℹ️-[TSLocationManager doStart:] trackingMode: 1 2024-06-27 17:20:34.775 ℹ️-[TSConfig persist] 2024-06-27 17:20:34.776 🎾-[TSGeofenceManager start] 2024-06-27 17:20:34.776 🎾-[SOMotionDetector startDetection] 2024-06-27 17:20:34.776 🔵-[TSLocationManager setPace:] 0 2024-06-27 17:20:34.778 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:20:34.778 ℹ️-[TSConfig persist] 2024-06-27 17:20:34.779 🔵-[TSLocationManager changePace:] isMoving: 1 2024-06-27 17:20:34.779 🔵-[TSLocationManager setPace:] 1 2024-06-27 17:20:34.779 🎾-[SOMotionDetector startShakeDetection:] sample-rate: 0.2 | M7 DISABLED 2024-06-27 17:20:34.780 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS 2024-06-27 17:20:34.791 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:20:34.793 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2024-06-27 17:20:34.794 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:20:34.795 ℹ️-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch 2024-06-27 17:20:34.811 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:20:34.811 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:20:34.811 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2024-06-27 17:20:34.822 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 17:20:34 Central European Summer Time 2024-06-27 17:20:34.822 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:20:34.822 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 17:20:34.822 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:20:34.822 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 2024-06-27 17:20:34.822 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Δt since last: 0.0s 2024-06-27 17:20:34.829 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:20:34.830 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Δt since last: 0.0s 2024-06-27 17:20:34.832 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:20:34.832 ✅-[BackgroundTaskManager createBackgroundTask] 10 2024-06-27 17:20:34.836 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:20:34.942 🎾-[TSGeofenceManager startMonitoringGeofence:] no-event-id-tenant 2024-06-27 17:20:34.942 🎾-[TSGeofenceManager startMonitoringGeofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:20:34.944 🎾-[TSGeofenceManager requestLocation] 2024-06-27 17:20:34.947 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:20:35.338 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:20:35.341 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:20:35.341 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 10 OF ( 10 ) 2024-06-27 17:20:35.792 🔴-[SOMotionDetector stopShakeDetection] OFF 2024-06-27 17:20:35.793 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates 2024-06-27 17:20:43.831 ✅-[BackgroundTaskManager createBackgroundTask] 16 2024-06-27 17:20:43.831 🔵-[TSLocationManager onSuspend:] enabled? 1) 2024-06-27 17:20:44.946 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 17:20:42 Central European Summer Time 2024-06-27 17:20:44.951 ✅-[TSGeofenceManager fireGeofenceEvent:] INSERT: 6DB7CEB6-0150-44AB-8449-815BCFDC67C6 2024-06-27 17:20:44.952 ✅-[BackgroundTaskManager createBackgroundTask] 25 2024-06-27 17:20:44.952 ✅-[BackgroundTaskManager createBackgroundTask] 26 2024-06-27 17:20:44.956 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:20:45.574 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:20:45.577 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:20:45.577 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 25 OF ( 16, 25, 26 ) 2024-06-27 17:20:45.964 🔵-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired 2024-06-27 17:20:45.964 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 26 OF ( 16, 26 ) 2024-06-27 17:20:50.487 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-06-27 17:21:00.492 🔵-[TSLocationManager beginStopDetection] ⏲Stop-timeout engaged: 300 s... 2024-06-27 17:21:00.508 🔵-[TSLocationManager locationManager:didUpdateLocations:] stoppedAt is set. Bailing out 2024-06-27 17:21:11.266 🔵-[TSLocationManager detectStopMotion:shakeCount:] Stationary-time: 10/300 s 2024-06-27 17:21:14.468 🔵-[TSLocationManager detectStopMotion:shakeCount:] Stationary-time: 13/300 s 2024-06-27 17:21:15.102 🔵-[TSLocationManager detectStopMotion:shakeCount:] Stationary-time: 14/300 s 2024-06-27 17:21:15.422 🔵-[TSLocationManager detectStopMotion:shakeCount:] Stationary-time: 14/300 s 2024-06-27 17:21:20.366 🔵-[BackgroundTaskManager onResume:] Current preventSuspend tasks: 1 2024-06-27 17:21:20.366 🔵-[TSLocationManager onResume:] enabled? 1 2024-06-27 17:21:27.091 ℹ️-[TSConfig persist] 2024-06-27 17:21:27.092 ℹ️-[TSConfig persist] 2024-06-27 17:21:27.093 ℹ️-[TSLocationManager resetStopTimeoutTimer] 2024-06-27 17:21:27.093 ℹ️-[TSLocationManager clearLastOdometerLocation] 2024-06-27 17:21:27.093 🔴-[TSGeofenceManager stop] 2024-06-27 17:21:27.093 🔴-[TSGeofenceManager stopMonitoringGeofences] 2024-06-27 17:21:27.104 🔴-[TSGeofenceManager stopMonitoringGeofences] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:21:27.104 🔴-[TSGeofenceManager stopMonitoringGeofences] no-event-id-tenant 2024-06-27 17:21:27.104 🔴-[PolygonGeofencingService stop] 2024-06-27 17:21:27.104 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 17:21:27.104 🔴-[SOMotionDetector stopDetection] OFF 2024-06-27 17:21:27.104 🔴-[TSLocationManager stopUpdatingLocation] 2024-06-27 17:21:27.106 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF 2024-06-27 17:21:27.107 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] 2024-06-27 17:21:28.867 🔵-[BackgroundTaskManager startPreventSuspendTimer:] BG time remaining: 20 | Total tasks: 1 2024-06-27 17:21:28.867 🔵-[TSLocationManager onSuspend:] enabled? 0) 2024-06-27 17:21:38.948 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 20.103342) 2024-06-27 17:21:38.978 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:21:42.046 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 17.003185) 2024-06-27 17:21:42.065 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:21:45.097 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 13.951817) 2024-06-27 17:21:45.112 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:21:48.172 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 10.877422) 2024-06-27 17:21:48.188 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:21:51.254 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 7.794715) 2024-06-27 17:21:51.269 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:21:54.370 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 4.679154) 2024-06-27 17:21:54.389 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:21:55.037 ⚠️-[BackgroundTaskManager createBackgroundTask]_block_invoke FORCE KILL BACKGROUND TASK: 16, remaining time: 4.011663 2024-06-27 17:21:55.037 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 16 OF ( 16 ) 2024-06-27 17:44:59.522 🔵-[TSLocationManager onResume:] enabled? 0 2024-06-27 17:45:13.365 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation stopObserving] 2024-06-27 17:45:13.377 ℹ️-[TSLocationManager removeListeners] 2024-06-27 17:45:15.459 ℹ️-[TSConfig persist] 2024-06-27 17:45:29.541 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 17:45:29.815 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation stopObserving] 2024-06-27 17:45:29.815 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 17:45:32.386 ℹ️-[GeofenceDAO destroyAll]_block_invoke 2024-06-27 17:45:32.386 🔴-[PolygonGeofencingService stop] 2024-06-27 17:45:32.386 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 17:45:32.387 🔵-[TSLocationManager addGeofences:success:failure:] 2024-06-27 17:45:32.389 ℹ️-[GeofenceDAO doInsert:geofence:] no-event-id-tenant 2024-06-27 17:45:32.389 ℹ️-[GeofenceDAO doInsert:geofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:45:32.405 ℹ️-[TSLocationManager doStart:] trackingMode: 1 2024-06-27 17:45:32.405 ℹ️-[TSConfig persist] 2024-06-27 17:45:32.407 🎾-[TSGeofenceManager start] 2024-06-27 17:45:32.407 🎾-[SOMotionDetector startDetection] 2024-06-27 17:45:32.408 🔵-[TSLocationManager setPace:] 0 2024-06-27 17:45:32.410 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:45:32.411 ℹ️-[TSConfig persist] 2024-06-27 17:45:32.411 ✅-[BackgroundTaskManager createBackgroundTask] 46 2024-06-27 17:45:32.413 🔵-[TSLocationManager changePace:] isMoving: 1 2024-06-27 17:45:32.413 🔵-[TSLocationManager setPace:] 1 2024-06-27 17:45:32.413 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:45:32.420 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:45:32.423 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2024-06-27 17:45:32.424 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:45:32.438 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates 2024-06-27 17:45:32.440 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:45:32.440 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2024-06-27 17:45:32.440 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2024-06-27 17:45:32.452 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 17:45:32 Central European Summer Time 2024-06-27 17:45:32.452 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:45:32.452 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 17:45:32.452 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:45:32.470 🎾-[TSGeofenceManager startMonitoringGeofence:] no-event-id-tenant 2024-06-27 17:45:32.470 🎾-[TSGeofenceManager startMonitoringGeofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:45:32.471 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 2024-06-27 17:45:32.471 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Δt since last: 0.0s 2024-06-27 17:45:32.472 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: E06A0EBD-1CB9-4776-A848-D0BAB8BCFDB0 2024-06-27 17:45:32.479 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:45:32.481 🎾-[TSGeofenceManager requestLocation] 2024-06-27 17:45:32.481 ⚠️-[TSHttpService flush:] Busy with previous request 2024-06-27 17:45:32.483 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:45:32.940 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:45:32.949 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:45:32.949 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 46 OF ( 46 ) 2024-06-27 17:45:33.498 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-06-27 17:45:42.481 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 17:45:40 Central European Summer Time 2024-06-27 17:45:42.493 ✅-[TSGeofenceManager fireGeofenceEvent:] INSERT: B0426474-65CC-4E28-93A9-99A73B53F111 2024-06-27 17:45:42.495 ✅-[BackgroundTaskManager createBackgroundTask] 50 2024-06-27 17:45:42.495 ✅-[BackgroundTaskManager createBackgroundTask] 51 2024-06-27 17:45:42.502 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:45:43.003 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:45:43.006 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:45:43.006 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 50 OF ( 50, 51 ) 2024-06-27 17:45:43.501 🔵-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired 2024-06-27 17:45:43.501 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 51 OF ( 51 ) 2024-06-27 17:45:43.501 🔵-[TSLocationManager beginStopDetection] ⏲Stop-timeout engaged: 300 s... 2024-06-27 17:45:43.510 🔵-[TSLocationManager locationManager:didUpdateLocations:] stoppedAt is set. Bailing out 2024-06-27 17:45:57.341 ℹ️-[TSConfig persist] 2024-06-27 17:45:57.344 ℹ️-[TSConfig persist] 2024-06-27 17:45:57.347 ℹ️-[TSLocationManager resetStopTimeoutTimer] 2024-06-27 17:45:57.347 ℹ️-[TSLocationManager clearLastOdometerLocation] 2024-06-27 17:45:57.347 🔴-[TSGeofenceManager stop] 2024-06-27 17:45:57.347 🔴-[TSGeofenceManager stopMonitoringGeofences] 2024-06-27 17:45:57.351 🔴-[TSGeofenceManager stopMonitoringGeofences] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:45:57.351 🔴-[TSGeofenceManager stopMonitoringGeofences] no-event-id-tenant 2024-06-27 17:45:57.351 🔴-[PolygonGeofencingService stop] 2024-06-27 17:45:57.352 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 17:45:57.352 🔴-[SOMotionDetector stopDetection] OFF 2024-06-27 17:45:57.352 🔴-[TSLocationManager stopUpdatingLocation] 2024-06-27 17:45:57.358 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF 2024-06-27 17:45:57.359 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] 2024-06-27 17:45:59.886 🔵-[TSLocationManager onSuspend:] enabled? 0) 2024-06-27 17:48:52.076 🔵-[TSLocationManager onResume:] enabled? 0 2024-06-27 17:48:54.018 🔵-[TSLocationManager onSuspend:] enabled? 0) 2024-06-27 17:48:54.072 🔵-[TSLocationManager onResume:] enabled? 0 2024-06-27 17:48:59.952 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation stopObserving] 2024-06-27 17:48:59.971 ℹ️-[TSLocationManager removeListeners] 2024-06-27 17:49:02.059 ℹ️-[TSConfig persist] 2024-06-27 17:49:03.860 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 17:49:05.274 🔵-[TSLocationManager onSuspend:] enabled? 0) 2024-06-27 17:49:05.307 ℹ️-[TSLocationManager removeListeners] 2024-06-27 17:49:06.649 ℹ️-[TSLocationManager init] ╔═════════════════════════════════════════════ ║ TSLocationManager (build 388) ╠══════════════════════════════════════════════ { activityRecognitionInterval = 10000; activityType = 1; authorization = { }; autoSync = 1; autoSyncThreshold = 0; batchSync = 0; debug = 1; desiredAccuracy = "-1"; desiredOdometerAccuracy = 100; didDeviceReboot = 0; didLaunchInBackground = 0; didRequestUpgradeLocationAuthorization = 0; disableAutoSyncOnCellular = 0; disableElasticity = 0; disableLocationAuthorizationAlert = 0; disableMotionActivityUpdates = 0; disableStopDetection = 0; distanceFilter = 10; elasticityMultiplier = 1; enableTimestampMeta = 0; enabled = 0; extras = { }; geofenceInitialTriggerEntry = 1; geofenceProximityRadius = 2000; geofenceTemplate = ""; headers = { }; heartbeatInterval = 60; httpRootProperty = "."; httpTimeout = 60000; iOSHasWarnedLocationServicesOff = 0; isFirstBoot = 0; isMoving = 0; lastLocationAuthorizationStatus = 3; locationAuthorizationAlert = { cancelButton = Cancel; instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings"; settingsButton = Settings; titleWhenNotEnabled = "Background location is not enabled"; titleWhenOff = "Location services are off"; }; locationAuthorizationRequest = Always; locationTemplate = ""; locationTimeout = 60; locationsOrderDirection = ASC; logLevel = 4; logMaxDays = 3; maxBatchSize = "-1"; maxDaysToPersist = 1; maxRecordsToPersist = "-1"; method = POST; minimumActivityRecognitionConfidence = 70; odometer = 0; params = { deviceId = "4accde77-1f72-4c0c-a253-4fff87c2c761"; employeeId = "20adbe56-24aa-43c2-9904-cda2fdf9e60d"; tenantId = "05968f11-7ee3-4c76-b8f1-5a99dc5b0f3c"; }; pausesLocationUpdatesAutomatically = 1; persistMode = 2; preventSuspend = 1; schedule = ( ); schedulerEnabled = 0; showsBackgroundLocationIndicator = 1; startOnBoot = 0; stationaryRadius = 25; stopAfterElapsedMinutes = 540; stopDetectionDelay = 0; stopOnStationary = 0; stopOnTerminate = 0; stopTimeout = 5; trackingMode = 1; url = "https://dev-api.bas.app/api/public/05968f11-7ee3-4c76-b8f1-5a99dc5b0f3c/location-events/transistor"; useSignificantChangesOnly = 0; } 2024-06-27 17:49:06.650 ℹ️-[GeofenceDAO init] CREATE TABLE IF NOT EXISTS geofences (id INTEGER PRIMARY KEY AUTOINCREMENT, identifier TEXT NOT NULL UNIQUE, latitude DOUBLE NOT NULL, sin_latitude DOUBLE NOT NULL, cos_latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, sin_longitude DOUBLE NOT NULL, cos_longitude DOUBLE NOT NULL, radius DOUBLE NOT NULL, notifyOnEntry BOOLEAN NOT NULL DEFAULT 0, notifyOnExit BOOLEAN NOT NULL DEFAULT 0, notifyOnDwell BOOLEAN NOT NULL DEFAULT 0, loiteringDelay DOUBLE NOT NULL DEFAULT 0, extras TEXT, vertices TEXT) 2024-06-27 17:49:06.650 ℹ️-[GeofenceDAO init] CREATE index IF NOT EXISTS identifier ON geofences (identifier);CREATE index IF NOT EXISTS latitude ON geofences (latitude);CREATE index IF NOT EXISTS longitude ON geofences (longitude);CREATE index IF NOT EXISTS sin_latitude ON geofences (sin_latitude);CREATE index IF NOT EXISTS cos_latitude ON geofences (cos_latitude);CREATE index IF NOT EXISTS sin_longitude ON geofences (sin_longitude);CREATE index IF NOT EXISTS cos_longitude ON geofences (cos_longitude); 2024-06-27 17:49:06.662 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3 2024-06-27 17:49:06.663 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:49:06.663 🔵-[PolygonGeofencingService locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:49:06.663 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:49:06.663 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:49:06.664 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-06-27 17:49:08.847 ℹ️-[TSConfig persist] 2024-06-27 17:49:08.885 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 17:49:12.365 ℹ️-[GeofenceDAO destroyAll]_block_invoke 2024-06-27 17:49:12.365 🔴-[PolygonGeofencingService stop] 2024-06-27 17:49:12.366 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 17:49:12.366 🔵-[TSLocationManager addGeofences:success:failure:] 2024-06-27 17:49:12.368 ℹ️-[GeofenceDAO doInsert:geofence:] no-event-id-tenant 2024-06-27 17:49:12.368 ℹ️-[GeofenceDAO doInsert:geofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:49:12.388 ℹ️-[TSLocationManager doStart:] trackingMode: 1 2024-06-27 17:49:12.388 ℹ️-[TSConfig persist] 2024-06-27 17:49:12.390 🎾-[TSGeofenceManager start] 2024-06-27 17:49:12.391 🎾-[SOMotionDetector startDetection] 2024-06-27 17:49:12.391 🔵-[TSLocationManager setPace:] 0 2024-06-27 17:49:12.394 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:49:12.395 ℹ️-[TSConfig persist] 2024-06-27 17:49:12.395 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS 2024-06-27 17:49:12.395 ✅-[BackgroundTaskManager createBackgroundTask] 8 2024-06-27 17:49:12.396 🔵-[TSLocationManager changePace:] isMoving: 1 2024-06-27 17:49:12.396 🔵-[TSLocationManager setPace:] 1 2024-06-27 17:49:12.396 🎾-[SOMotionDetector startShakeDetection:] sample-rate: 0.2 | M7 DISABLED 2024-06-27 17:49:12.397 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:12.406 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:49:12.409 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2024-06-27 17:49:12.409 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:49:12.415 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates 2024-06-27 17:49:12.449 🎾-[TSGeofenceManager startMonitoringGeofence:] no-event-id-tenant 2024-06-27 17:49:12.449 🎾-[TSGeofenceManager startMonitoringGeofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:49:12.449 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 17:49:09 Central European Summer Time 2024-06-27 17:49:12.449 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:49:12.449 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 17:49:12.449 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:49:12.557 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 2024-06-27 17:49:12.557 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 17:49:12.557 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:49:12.557 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Δt since last: 0.0s 2024-06-27 17:49:12.557 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Δt since last: 0.0s 2024-06-27 17:49:12.557 🎾-[TSGeofenceManager requestLocation] 2024-06-27 17:49:12.559 ℹ️-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch 2024-06-27 17:49:12.560 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: E8825B84-1ABB-4586-8080-2671DBF1C556 2024-06-27 17:49:12.561 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 17:49:12.562 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:49:12.566 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 6D88C8DF-F6A2-487E-83F2-968B8A11A120 2024-06-27 17:49:12.569 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:49:12.569 ⚠️-[TSHttpService flush:] Busy with previous request 2024-06-27 17:49:12.571 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 17:49:12.571 ⚠️-[TSHttpService flush:] Busy with previous request 2024-06-27 17:49:12.996 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:49:13.007 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:13.007 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 8 OF ( 8 ) 2024-06-27 17:49:18.437 🔵-[TSLocationManager locationManager:didUpdateLocations:] Updated distanceFilter, new: 10.000000, old: -1.000000 2024-06-27 17:49:18.438 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 17:49:18.438 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:49:18.450 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 89AEF0D5-C3C3-491F-8335-E7025E990938 2024-06-27 17:49:18.452 ✅-[BackgroundTaskManager createBackgroundTask] 11 2024-06-27 17:49:18.454 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:19.137 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:49:19.147 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:19.147 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 11 OF ( 11 ) 2024-06-27 17:49:21.058 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-06-27 17:49:22.559 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 17:49:19 Central European Summer Time 2024-06-27 17:49:22.561 ✅-[TSGeofenceManager fireGeofenceEvent:] INSERT: 4713A1B6-B81A-4ED3-B28E-A16E06AA3698 2024-06-27 17:49:22.562 ✅-[BackgroundTaskManager createBackgroundTask] 12 2024-06-27 17:49:22.562 ✅-[BackgroundTaskManager createBackgroundTask] 13 2024-06-27 17:49:22.564 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:23.094 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:49:23.104 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:23.104 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 12 OF ( 12, 13 ) 2024-06-27 17:49:23.575 🔵-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired 2024-06-27 17:49:23.575 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 13 OF ( 13 ) 2024-06-27 17:49:23.709 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 17:49:23.709 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 17:49:23.713 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 22FF9AB3-53F9-4897-A83C-3149155E46DA 2024-06-27 17:49:23.716 ✅-[BackgroundTaskManager createBackgroundTask] 14 2024-06-27 17:49:23.717 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:24.287 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 17:49:24.288 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 17:49:24.288 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 14 OF ( 14 ) 2024-06-27 17:49:31.059 🔵-[TSLocationManager beginStopDetection] ⏲Stop-timeout engaged: 300 s... 2024-06-27 17:49:31.068 🔵-[TSLocationManager locationManager:didUpdateLocations:] stoppedAt is set. Bailing out 2024-06-27 17:49:33.415 ℹ️-[TSConfig persist] 2024-06-27 17:49:33.418 ℹ️-[TSConfig persist] 2024-06-27 17:49:33.420 ℹ️-[TSLocationManager resetStopTimeoutTimer] 2024-06-27 17:49:33.420 ℹ️-[TSLocationManager clearLastOdometerLocation] 2024-06-27 17:49:33.420 🔴-[TSGeofenceManager stop] 2024-06-27 17:49:33.420 🔴-[TSGeofenceManager stopMonitoringGeofences] 2024-06-27 17:49:33.424 🔴-[TSGeofenceManager stopMonitoringGeofences] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 17:49:33.425 🔴-[TSGeofenceManager stopMonitoringGeofences] no-event-id-tenant 2024-06-27 17:49:33.425 🔴-[PolygonGeofencingService stop] 2024-06-27 17:49:33.425 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 17:49:33.425 🔴-[SOMotionDetector stopDetection] OFF 2024-06-27 17:49:33.425 🔴-[SOMotionDetector stopShakeDetection] OFF 2024-06-27 17:49:33.426 🔴-[TSLocationManager stopUpdatingLocation] 2024-06-27 17:49:33.427 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF 2024-06-27 17:49:33.428 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] 2024-06-27 17:49:36.309 🔵-[TSLocationManager onSuspend:] enabled? 0) 2024-06-27 17:54:21.405 🔵-[TSLocationManager onResume:] enabled? 0 2024-06-27 17:54:23.550 🔵-[TSLocationManager onSuspend:] enabled? 0) 2024-06-27 18:03:33.433 🔵-[TSLocationManager onResume:] enabled? 0 2024-06-27 18:03:42.516 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation stopObserving] 2024-06-27 18:03:42.537 ℹ️-[TSLocationManager removeListeners] 2024-06-27 18:03:44.623 ℹ️-[TSConfig persist] 2024-06-27 18:03:50.833 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 18:03:51.117 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation stopObserving] 2024-06-27 18:03:51.117 ℹ️-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-06-27 18:03:54.669 ℹ️-[GeofenceDAO destroyAll]_block_invoke 2024-06-27 18:03:54.669 🔴-[PolygonGeofencingService stop] 2024-06-27 18:03:54.669 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 18:03:54.669 🔵-[TSLocationManager addGeofences:success:failure:] 2024-06-27 18:03:54.670 ℹ️-[GeofenceDAO doInsert:geofence:] no-event-id-tenant 2024-06-27 18:03:54.670 ℹ️-[GeofenceDAO doInsert:geofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 18:03:54.681 ℹ️-[TSLocationManager doStart:] trackingMode: 1 2024-06-27 18:03:54.681 ℹ️-[TSConfig persist] 2024-06-27 18:03:54.682 🎾-[TSGeofenceManager start] 2024-06-27 18:03:54.683 🎾-[SOMotionDetector startDetection] 2024-06-27 18:03:54.683 🔵-[TSLocationManager setPace:] 0 2024-06-27 18:03:54.684 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 18:03:54.685 ℹ️-[TSConfig persist] 2024-06-27 18:03:54.685 ✅-[BackgroundTaskManager createBackgroundTask] 37 2024-06-27 18:03:54.687 🔵-[TSLocationManager changePace:] isMoving: 1 2024-06-27 18:03:54.687 🔵-[TSLocationManager setPace:] 1 2024-06-27 18:03:54.687 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 18:03:54.693 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 18:03:54.696 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2024-06-27 18:03:54.697 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 18:03:54.700 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 18:03:54.706 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2024-06-27 18:03:54.709 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates 2024-06-27 18:03:54.709 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2024-06-27 18:03:54.734 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 18:03:54 Central European Summer Time 2024-06-27 18:03:54.734 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-06-27 18:03:54.734 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0 2024-06-27 18:03:54.734 ℹ️-[PolygonGeofencingService setLocation:] Already updating location 2024-06-27 18:03:54.745 🎾-[TSGeofenceManager startMonitoringGeofence:] no-event-id-tenant 2024-06-27 18:03:54.745 🎾-[TSGeofenceManager startMonitoringGeofence:] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 18:03:54.745 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 2024-06-27 18:03:54.746 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 622DFF65-53D6-451B-A8CA-F5272BF7A114 2024-06-27 18:03:54.919 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 18:03:54.920 🎾-[TSGeofenceManager requestLocation] 2024-06-27 18:03:54.921 ⚠️-[TSHttpService flush:] Busy with previous request 2024-06-27 18:03:54.923 ℹ️+[LocationAuthorization run:onCancel:] status: 3 2024-06-27 18:03:55.251 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 18:03:55.260 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 18:03:55.261 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 37 OF ( 37 ) 2024-06-27 18:04:04.921 🔵-[TSGeofenceManager locationManager:didUpdateLocations:] <+51.46129396,+5.61143456> +/- 35.00m (speed -1.00 mps / course -1.00) @ 27/06/2024, 18:04:01 Central European Summer Time 2024-06-27 18:04:04.933 ✅-[TSGeofenceManager fireGeofenceEvent:] INSERT: 2FD0526B-1990-4780-AE24-9A604B3061FB 2024-06-27 18:04:04.934 ✅-[BackgroundTaskManager createBackgroundTask] 38 2024-06-27 18:04:04.935 ✅-[BackgroundTaskManager createBackgroundTask] 39 2024-06-27 18:04:04.937 ✅-[TSHttpService schedulePost] LOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 18:04:05.492 ⚠️-[HttpResponse handleResponse] HTTP ERROR: 202 *** 2024-06-27 18:04:05.502 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 795FF840-D06B-4DAD-81EF-17B0D7DEE090 2024-06-27 18:04:05.502 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 38 OF ( 38, 39 ) 2024-06-27 18:04:05.938 🔵-[TSGeofenceManager evaluateProximity:delay:]_block_invoke Re-evaluation timer fired 2024-06-27 18:04:05.938 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 39 OF ( 39 ) 2024-06-27 18:04:15.072 ℹ️-[TSConfig persist] 2024-06-27 18:04:15.074 ℹ️-[TSConfig persist] 2024-06-27 18:04:15.076 ℹ️-[TSLocationManager clearLastOdometerLocation] 2024-06-27 18:04:15.076 🔴-[TSGeofenceManager stop] 2024-06-27 18:04:15.076 🔴-[TSGeofenceManager stopMonitoringGeofences] 2024-06-27 18:04:15.089 🔴-[TSGeofenceManager stopMonitoringGeofences] 26de35ea-5513-4c2e-b4a5-a7f43a7eecd1-primaryFromAddress 2024-06-27 18:04:15.089 🔴-[TSGeofenceManager stopMonitoringGeofences] no-event-id-tenant 2024-06-27 18:04:15.089 🔴-[PolygonGeofencingService stop] 2024-06-27 18:04:15.090 ℹ️-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-06-27 18:04:15.090 🔴-[SOMotionDetector stopDetection] OFF 2024-06-27 18:04:15.090 🔴-[TSLocationManager stopUpdatingLocation] 2024-06-27 18:04:15.095 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF 2024-06-27 18:04:15.098 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] ```
christocracy commented 2 months ago

You should be registering event-listeners before calling ready or you can miss events.

// Listen to events BEFORE calling .ready
BackgroundGeolocation.onEnabledChange((event) => {
  console.log('- onEnabledChange: ', event);
});

BackgroundGeolocation.ready(config);

// NOT AFTER
BackgroundGeolocation.onEnabledChange((event) => {
  console.log('- onEnabledChange: ', event);
});
christocracy commented 2 months ago

Listening to event-listeners is a completely innocuous action -- it does nothing more than push a callback function onto an Array. You do not need to wait for anything to add a listener. It's perfectly fine to register listeners even if you don't have a logged-in user.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

gigby commented 1 month ago

@christocracy I have RN 0.72, plugin version 4.14.3 and the same issue. But I did set listeners BEFORE calling .ready() method. It works as expected on Android 14. And there is one more interesting moment: onLocation callback fires as expected.

christocracy commented 1 month ago

There is no difference in performance between a debug and release build. To believe so is nothing more than superstition, like believing that walking under a ladder brings bad luck.

the first thing you do when something unusual happens is analyze your logs. See wiki “Debugging” and api docs “.emailLog”. Place a geofence 200 meters away then go outside with a REAL device (not emulator) and walk into it with the plug-in configured for debug: true (so you can hear the debug sound FX). Go outside and walk in/out of your test geofence.

gigby commented 1 month ago

@christocracy Was your previous message addressed to me? If so, I don't understand how walking with the real device can help to catch missing "onEnabled" callback? I see this issue on the dev/prod builds and I test your plugin on real devices only. The issue exists on iPhone XS Max, Android 14 Samsung device and iOS iPhone simulator.

christocracy commented 1 month ago

The title of this issue is “onEnabled and onGeofence not triggering on production but does work on development”.

you said you have the “same issue”.

gigby commented 1 month ago

@christocracy I wasn't accurate when was reading issue title. I'm sorry. I have NO the same issue. It's something different.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity.