react-native-background-geolocation: Android Location services abruptly terminated after ~ 1 onLocation event

In the android environment, app will work when the stars align, but something often causes the location tracking to crash, leading to no more onLocation events for unknown reason. Most often this occurs more or less straight away, if the app begins tracking for more than a handful of updates it usually keeps tracking

Your Environment

  • Plugin version: 3.9.0
  • Platform: Android
  • OS version: pixel 2 api 30
  • Device manufacturer / model:
  • React Native version (react-native -v): 0.63.2
  • Plugin config ( in componentDidMount, in a screen component)
    BackgroundGeolocation.ready(
      {
        reset: true, // <-- true to always apply the supplied config
        distanceFilter: 1,
        logLevel: 5,
        debug: true // <-- enable debug sounds/notifications
      },
      (state) => {
        BackgroundGeolocation.start(function () {
          console.log("- Started background Geolocation successfully");
        });
      }
    );
    
    BackgroundGeolocation.onLocation((position) => {
      this.trackPosition(position);
    //   this.saveState();
    }, this.onError);

Expected Behavior

OnLocation fires according to distance parameter, so a few times a second.

Actual Behavior

onLocation fires once then bggeolocation records termination in logs. This isn’t universal behaviour, under certain conditions onLocation will fire as expected, i have not managed to spot a consistent pattern in this behaviour yet. App works as expected in iOS Simulator Stripped back or not.

Steps to Reproduce

I have stripped back the screen responsible for tracking in the app till it more or less resembles the most basic examples given in the Docs. TrackPosition currently just logs to console.

Context

Debug logs

Logs
09-25 11:45:50.777  7100  7100 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 
09-25 11:45:50.777  7100  7100 I TSLocationManager:   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
09-25 11:45:57.277  7300  7340 I TSLocationManager: [c.t.l.adapter.TSConfig print] 
09-25 11:45:57.277  7300  7340 I TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:45:57.277  7300  7340 I TSLocationManager: ║ TSLocationManager version: 3.1.12 (368)
09-25 11:45:57.277  7300  7340 I TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:45:57.277  7300  7340 I TSLocationManager: ╟─ Google sdk_gphone_x86 @ 11 (react-native)
09-25 11:45:57.277  7300  7340 I TSLocationManager: {
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "activityRecognitionInterval": 10000,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "allowIdenticalLocations": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "authorization": {},
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "autoSync": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "autoSyncThreshold": 0,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "batchSync": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "configUrl": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "debug": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "deferTime": 0,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "desiredAccuracy": 0,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "desiredOdometerAccuracy": 100,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "disableAutoSyncOnCellular": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "disableElasticity": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "disableLocationAuthorizationAlert": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "disableMotionActivityUpdates": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "disableStopDetection": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "distanceFilter": 1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "elasticityMultiplier": 1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "enableHeadless": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "enableTimestampMeta": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "encrypt": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "extras": {},
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "fastestLocationUpdateInterval": -1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "foregroundService": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "geofenceInitialTriggerEntry": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "geofenceModeHighAccuracy": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "geofenceProximityRadius": 1000,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "geofenceTemplate": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "headers": {},
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "headlessJobService": "com.transistorsoft.rnbackgroundgeolocation.HeadlessTask",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "heartbeatInterval": -1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "httpRootProperty": "location",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "httpTimeout": 60000,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "isMoving": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "locationAuthorizationRequest": "Always",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "locationTemplate": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "locationTimeout": 60,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "locationUpdateInterval": 1000,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "locationsOrderDirection": "ASC",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "logLevel": 5,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "logMaxDays": 3,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "maxBatchSize": -1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "maxDaysToPersist": 1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "maxRecordsToPersist": -1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "method": "POST",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "minimumActivityRecognitionConfidence": 75,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "motionTriggerDelay": 0,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "notification": {
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "layout": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "title": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "text": "Location Service activated",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "color": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "channelName": "TSLocationManager",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "smallIcon": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "largeIcon": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "priority": 0,
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "sticky": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "strings": {},
09-25 11:45:57.277  7300  7340 I TSLocationManager:     "actions": []
09-25 11:45:57.277  7300  7340 I TSLocationManager:   },
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "params": {},
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "persist": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "persistMode": 2,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "schedule": [],
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "scheduleUseAlarmManager": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "speedJumpFilter": 300,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "startOnBoot": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "stationaryRadius": 25,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "stopAfterElapsedMinutes": 0,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "stopOnStationary": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "stopOnTerminate": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "stopTimeout": 5,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "url": "",
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "useSignificantChangesOnly": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "enabled": true,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "schedulerEnabled": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "trackingMode": 1,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "odometer": 29463.490234375,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "isFirstBoot": false,
09-25 11:45:57.277  7300  7340 I TSLocationManager:   "didLaunchInBackground": false
09-25 11:45:57.277  7300  7340 I TSLocationManager: }
09-25 11:45:57.281  7300  7340 I TSLocationManager: [c.t.l.adapter.TSConfig print] 
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:45:57.281  7300  7340 I TSLocationManager: ║ DEVICE SENSORS
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╟─ ✅  ACCELEROMETER: {Sensor name="Goldfish 3-axis Accelerometer", vendor="The Android Open Source Project", version=1, type=1, maxRange=39.299976, resolution=2.480159E-4, power=3.0, minDelay=10000}
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╟─ ✅  GYROSCOPE: {Sensor name="Goldfish 3-axis Gyroscope", vendor="The Android Open Source Project", version=1, type=4, maxRange=16.460001, resolution=0.001, power=3.0, minDelay=10000}
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╟─ ✅  MAGNETOMETER: {Sensor name="Goldfish 3-axis Magnetic field sensor", vendor="The Android Open Source Project", version=1, type=2, maxRange=2000.0, resolution=0.5, power=6.7, minDelay=10000}
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╟─ ⚠️  SIGNIFICANT_MOTION:  none.  Motion-detection system performance will be degraded
09-25 11:45:57.281  7300  7340 I TSLocationManager: ╚═════════════════════════════════════════════
09-25 11:45:57.314  7300  7330 I TSLocationManager: [c.t.l.a.BackgroundGeolocation <init>] 
09-25 11:45:57.314  7300  7330 I TSLocationManager:   ✅  Google Play Services: connected (version code:12451000)
09-25 11:45:57.341  7300  7330 D TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 
09-25 11:45:57.341  7300  7330 D TSLocationManager:   🎾  Start monitoring connectivity changes
09-25 11:45:57.346  7300  7346 D TSLocationManager: [c.t.l.l.TSLocationManager$d run] 
09-25 11:45:57.346  7300  7346 D TSLocationManager:   ℹ️  Load last odometer location: Location[TSLocationManager 36.675613,137.844998 hAcc=5 t=?!? et=?!? vAcc=??? sAcc=??? bAcc=??? {Bundle[{odometer=29463.49}]}]
09-25 11:45:57.359  7300  7349 D TSLocationManager: [c.t.l.http.HttpService a] 
09-25 11:45:57.359  7300  7349 D TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:45:57.359  7300  7349 D TSLocationManager: ║ 📶  Connectivity change: connected? true
09-25 11:45:57.359  7300  7349 D TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:45:57.377  7300  7330 I TSLocationManager: [c.t.l.a.BackgroundGeolocation d] 
09-25 11:45:57.377  7300  7330 I TSLocationManager:   🎾  Start monitoring location-provider changes
09-25 11:45:57.414  7300  7344 D TSLocationManager: [c.t.l.data.sqlite.b prune] 
09-25 11:45:57.414  7300  7344 D TSLocationManager:   ℹ️  PRUNE -1 days
09-25 11:45:57.422  7300  7330 I TSLocationManager: [c.t.l.adapter.TSConfig$c a] 
09-25 11:45:57.422  7300  7330 I TSLocationManager:   ⚠️  Tracking initiated in background with stopOnTerminate: true.  Launch refused.
09-25 11:45:57.479  7300  7330 D TSLocationManager: [c.t.l.l.TSLocationManager clearLastOdometerLocation] 
09-25 11:45:57.479  7300  7330 D TSLocationManager:   ℹ️  Clear last odometer location
09-25 11:45:57.481  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: false]
09-25 11:45:57.506  7300  7330 I TSLocationManager: [c.t.l.s.ActivityRecognitionService c] 
09-25 11:45:57.506  7300  7330 I TSLocationManager:   🔴  Stop motion-activity updates
09-25 11:45:57.519  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
09-25 11:45:57.519  7300  7300 D TSLocationManager:   🔴  TrackingService destroyed
09-25 11:45:57.522  7300  7344 D TSLocationManager: [c.t.l.g.TSGeofenceManager c] ℹ️  Persist monitored geofences: []
09-25 11:45:57.524  7300  7344 D TSLocationManager: [c.t.l.g.TSGeofenceManager e] 
09-25 11:45:57.524  7300  7344 D TSLocationManager:   🔴  Stop monitoring geofences
09-25 11:45:57.529  7300  7330 I TSLocationManager: [c.t.l.service.HeartbeatService c] 
09-25 11:45:57.529  7300  7330 I TSLocationManager:   🔴  Stop heartbeat
09-25 11:45:57.543  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish GeofencingService [eventCount: 0, sticky: false]
09-25 11:45:57.550  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
09-25 11:45:57.550  7300  7300 D TSLocationManager:   🔴  GeofencingService destroyed
09-25 11:45:57.560  7300  7330 D TSLocationManager: [c.t.l.http.HttpService stopMonitoringConnectivityChanges] 
09-25 11:45:57.560  7300  7330 D TSLocationManager:   🔴  Stop monitoring connectivity changes
09-25 11:45:57.596  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish ActivityRecognitionService [eventCount: 0, sticky: false]
09-25 11:45:57.598  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
09-25 11:45:57.598  7300  7300 D TSLocationManager:   🔴  ActivityRecognitionService destroyed
09-25 11:46:00.830  7300  7360 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent onOneShot] 
09-25 11:46:00.830  7300  7360 I TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:46:00.830  7300  7360 I TSLocationManager: ║ ⏰ OneShot event fired: TERMINATE_EVENT
09-25 11:46:00.830  7300  7360 I TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:46:00.833  7300  7360 D TSLocationManager: [c.t.l.event.TerminateEvent <init>] 
09-25 11:46:00.833  7300  7360 D TSLocationManager:   ℹ️  TERMINATE_EVENT ignored (MainActivity is still active).
09-25 11:46:03.581  7300  7300 I ReactNative: [GESTURE HANDLER] Gesture handler is already enabled for a parent view
09-25 11:46:03.588  7300  7300 I ReactNative: [GESTURE HANDLER] Initialize gesture handler for root view com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{7c47598 V.E...... ......ID 0,0-1080,1731 #1}
09-25 11:46:17.613  7300  7355 D TSLocationManager: [c.t.l.adapter.TSConfig d] ℹ️   Persist config, dirty: [debug, distanceFilter, headlessJobService, logLevel]
09-25 11:46:17.653  7300  7355 D TSLocationManager: [c.t.l.a.BackgroundGeolocation ready] LocationPermission :true
09-25 11:46:17.691  7300  7355 D TSLocationManager: [c.t.locationmanager.util.b a] 
09-25 11:46:17.691  7300  7355 D TSLocationManager:   ℹ️  LocationAuthorization: Permission granted
09-25 11:46:17.696  7300  7361 I TSLocationManager: - Enable: false → true, trackingMode: 1
09-25 11:46:17.726  7300  7361 I TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 
09-25 11:46:17.726  7300  7361 I TSLocationManager:   🎾  Start motion-activity updates
09-25 11:46:17.736  7300  7361 D TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 
09-25 11:46:17.736  7300  7361 D TSLocationManager:   🎾  Start monitoring connectivity changes
09-25 11:46:17.747  7300  7349 D TSLocationManager: [c.t.l.http.HttpService a] 
09-25 11:46:17.747  7300  7349 D TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:46:17.747  7300  7349 D TSLocationManager: ║ 📶  Connectivity change: connected? true
09-25 11:46:17.747  7300  7349 D TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:46:17.748  7300  7361 D TSLocationManager: [c.t.locationmanager.device.a c] 
09-25 11:46:17.748  7300  7361 D TSLocationManager:   🎾  Start monitoring powersave changes
09-25 11:46:17.755  7300  7361 I TSLocationManager: [c.t.l.service.HeartbeatService c] 
09-25 11:46:17.755  7300  7361 I TSLocationManager:   🔴  Stop heartbeat
09-25 11:46:17.843  7300  7361 D TSLocationManager: [c.t.locationmanager.util.b b] 
09-25 11:46:17.843  7300  7361 D TSLocationManager:   ℹ️  LocationAuthorization: Permission granted
09-25 11:46:17.844  7300  7361 I TSLocationManager: [c.t.l.service.TrackingService a] 
09-25 11:46:17.844  7300  7361 I TSLocationManager:   🔵  setPace: false → false
09-25 11:46:17.855  7300  7300 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 
09-25 11:46:17.855  7300  7300 I TSLocationManager:   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
09-25 11:46:17.980  7300  7300 D TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): 0
09-25 11:46:18.237  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] 
09-25 11:46:18.237  7300  7300 D TSLocationManager:   🎾  LocationRequestService [eventCount: 1]
09-25 11:46:18.240  7300  7352 I TSLocationManager: [c.t.l.s.LocationRequestService a] 
09-25 11:46:18.240  7300  7352 I TSLocationManager:   ℹ️  Location availability: true
09-25 11:46:18.240  7300  7352 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
09-25 11:46:18.735  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] 
09-25 11:46:18.735  7300  7300 D TSLocationManager:   🎾  LocationRequestService [eventCount: 1]
09-25 11:46:18.741  7300  7361 I TSLocationManager: [c.t.l.s.LocationRequestService b] 
09-25 11:46:18.741  7300  7361 I TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:46:18.741  7300  7361 I TSLocationManager: ║ motionchange LocationResult: 1
09-25 11:46:18.741  7300  7361 I TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:46:18.741  7300  7361 I TSLocationManager: ╟─ 📍  Location[fused 36.674293,137.844998 hAcc=5 et=+15h14m40s866ms alt=728.6 vel=3.271864 bear=180.0 vAcc=1 sAcc=1 bAcc=30 {Bundle[mParcelledData.dataSize=52]}], age: 90ms, time: 1601001978612
09-25 11:46:18.748  7300  7361 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 
09-25 11:46:18.748  7300  7361 I TSLocationManager:   🔵  Acquired motionchange position, isMoving: false
09-25 11:46:18.749  7300  7361 D TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 5.0
09-25 11:46:18.761  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
09-25 11:46:18.773  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
09-25 11:46:18.773  7300  7300 D TSLocationManager:   🔴  LocationRequestService destroyed
09-25 11:46:18.897  7300  7361 D TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 1 isFinished? true
09-25 11:46:18.897  7300  7361 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
09-25 11:46:18.907  7300  7360 I TSLocationManager: [c.t.l.data.sqlite.b persist] 
09-25 11:46:18.907  7300  7360 I TSLocationManager:   ✅  INSERT: 4d73c2ef-a761-4991-8d3c-90e7667ffb8f
09-25 11:46:18.911  7300  7300 I TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 
09-25 11:46:18.911  7300  7300 I TSLocationManager:   🎾  Start motion-activity updates
09-25 11:46:18.913  7300  7300 D TSLocationManager: [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion] 
09-25 11:46:18.913  7300  7300 D TSLocationManager:   🎾  Start monitoring stationary region (radius: 150.0m 36.6742933,137.8449983 hAcc=5.0)
09-25 11:46:19.024  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] 
09-25 11:46:19.024  7300  7300 D TSLocationManager:   🎾  TrackingService [eventCount: 1]
09-25 11:46:19.025  7300  7300 I TSLocationManager: [c.t.l.service.TrackingService h] 
09-25 11:46:19.025  7300  7300 I TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:46:19.025  7300  7300 I TSLocationManager: ║ TrackingService motionchange: false
09-25 11:46:19.025  7300  7300 I TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:46:19.025  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService a] ⚙️︎  finish TrackingService [eventCount: 0, sticky: false]
09-25 11:46:19.286  7300  7300 D TSLocationManager: [c.t.l.service.AbstractService onDestroy] 
09-25 11:46:19.286  7300  7300 D TSLocationManager:   🔴  TrackingService destroyed
09-25 11:46:27.917  7300  7344 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent onOneShot] 
09-25 11:46:27.917  7300  7344 I TSLocationManager: ╔═════════════════════════════════════════════
09-25 11:46:27.917  7300  7344 I TSLocationManager: ║ ⏰ OneShot event fired: TERMINATE_EVENT
09-25 11:46:27.917  7300  7344 I TSLocationManager: ╠═════════════════════════════════════════════
09-25 11:46:27.921  7300  7344 D TSLocationManager: [c.t.l.event.TerminateEvent <init>] 
09-25 11:46:27.921  7300  7344 D TSLocationManager:   ℹ️  TERMINATE_EVENT ignored (MainActivity is still active).

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

@btuck044 The onMotionChange event is not very sensitive. The confusion for me arose in that the iOS simulator registered moving just fine, and the android VM ‘sometimes’ did, so it was confusing to work out exactly why it would sometimes work and others not. If the android VM couldn’t fire the onMoving because no gyro feedback then fine, but then it would never work, rather than work sporadically. Then when dealing with a real device walking or cycling around nearby, the code i wrote would not behave as sensitively as the demo app does, which was my problem, so what was the difference?

The philosophy of operation that Chris loves does hint at the answer, but it would really be a lot easier if it was explicitly said at some point that the motion sensitivity is often not hugely sensitive so at least for smaller, non motor vehicle tracking it is best that you manually switch the plugin to a moving state using the changePace(true) method, which is exactly what the demo app does.

In fact i would imagine including the changePace(true) method on the front page basic usage description with a brief explanation of the limits of device/VM sensitivity with respect to the philosophy of operation / isMoving recognition would both serve to manage expectations and save people the time of rooting through the demo app code to find that one line that is far more important than is let on.