Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background location tracking not enable when app is terminated #987

Closed
jeya-duraisamy opened this issue Aug 26, 2019 · 28 comments
Closed

Background location tracking not enable when app is terminated #987

jeya-duraisamy opened this issue Aug 26, 2019 · 28 comments
Labels

Comments

@jeya-duraisamy
Copy link

jeya-duraisamy commented Aug 26, 2019

Your Environment

  • Plugin version: 3.2.0
  • Platform: iOS
  • OS version: 12.4
  • Device manufacturer / model: Apple / iPhone 7
  • Cordova version (cordova -v): 9.0.3
  • Cordova platform version (cordova platform ls): 5.0.1
  • Plugin config provided to #ready:
  configureBackgroundGeolocation( startTracking: boolean ) {
    BackgroundGeolocation.ready({
      reset: true,
      debug: true,
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 50,
      stopTimeout: 1,
      stopOnTerminate: false,
      startOnBoot: true,
      //foregroundService: true,
      autoSync: true,
      url: "customUrl",
      headers: {
        'CUSTOM-TOKEN-KEY' : this.customToken
      }
    }, ( state ) => {
      this.backgroundGPSState = state;
      this.locationTrackingService.setBackgroundGPSState( this.backgroundGPSState );
       // 3.  Start tracking, this is coming from toggle button
      if ( !this.backgroundGPSState.enabled && startTracking) {
        BackgroundGeolocation.start();
      } else if ( !startTracking ) {
        BackgroundGeolocation.stop();
      }
    });
}
    

Expected Behavior

After the application is killed, location tracking should start working after driving 2-3 miles

Actual Behavior

After the application is killed, location tracking is not getting enabled even after driving for 15 miles. It enabled only when opening the app back again.

Steps to Reproduce

  1. Open the app, start location tracking
  2. Drive for 2-3 miles
  3. Kill the app
  4. Drive for 5-7 miles
  5. In the attached log, between 2019-08-25 12:32 and 2019-08-25 12:57 I had the app killed, and at 12:57 I opened the app, in the platform ready of it I fetch the log and send it in email using emailLog.

Note:
1. Background location tracking is getting enabled if I test the code with simulator running on iPhone Xr.
2. Ionic Appflow is used for building app to test on devices

customToken;
backgroundGPSState;

constructor(   private platform: Platform, private storage: Storage, private locationTrackingService: LocationTrackingService, 
                    private authService: AuthService, private dateUtilService: DateUtilService ) {

    this.currentTimestamp = this.dateUtilService.getCurrentDateTimeForInput();

    this.platform.ready().then(() => {
      BackgroundGeolocation.emailLog('xyz@abc.com').then((success) => {
        console.log('[emailLog] success');
      }).catch((error) => {
        console.log('[emailLog] FAILURE: ', error);
      });
      
      this.storage.get('isAppGPSEnabled').then( isAppGPSEnabled => {
        if ( isAppGPSEnabled === null || isAppGPSEnabled === undefined || !isAppGPSEnabled ) {
          this.configureBackgroundGeolocation( false );
          if ( this.backgroundGPSState ) {
            BackgroundGeolocation.stop();
          }
        } else if ( isAppGPSEnabled ) {
          this.configureBackgroundGeolocation( true );
        }
      });
      // Set the additional user token
      this.authService.getCustomToken().then( token => {
        this.customToken = token;
        BackgroundGeolocation.setConfig( {
            headers: {
              'CUSTOM-TOKEN-KEY' : this.customToken
            }
          }
        ).then(
          () => console.log('Config Change success, added user token!!!!!')
        );
      });

    });
  }

  ngOnInit() {
    // Subscribe to toggle event.
    this.locationTrackingService.toggleGPSPermission.subscribe( toggle => {
      if ( toggle.enabled ) {
        this.configureBackgroundGeolocation( true );
      } else if ( !toggle.enabled ) {
        BackgroundGeolocation.stop();
      }
    } );
  }

    configureBackgroundGeolocation( startTracking: boolean ) {
    BackgroundGeolocation.ready({
      reset: true,
      debug: true,
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 50,
      stopTimeout: 1,
      stopOnTerminate: false,
      startOnBoot: true,
      //foregroundService: true,
      autoSync: true,
      url: "customUrl",
      headers: {
        'CUSTOM-TOKEN-KEY' : this.customToken
      }
    }, ( state ) => {
      this.backgroundGPSState = state;
      this.locationTrackingService.setBackgroundGPSState( this.backgroundGPSState );
       // 3.  Start tracking, this is coming from toggle button
      if ( !this.backgroundGPSState.enabled && startTracking) {
        BackgroundGeolocation.start();
      } else if ( !startTracking ) {
        BackgroundGeolocation.stop();
      }
    });
}

Context

Background location tracking after the app is killed and the device is in motion

Debug logs

Logs - from emailLog
2019-08-25 12:09:17.671 ℹ️-[TSConfig persist] 

2019-08-25 12:09:17.673 🔵-[TSLocationManager ready] 

2019-08-25 12:09:17.699 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager stop] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:17.700 ℹ️-[TSLocationManager clearLastOdometerLocation] 

2019-08-25 12:09:17.700 🔴-[TSGeofenceManager stop] 

2019-08-25 12:09:17.701 🔴-[TSGeofenceManager stopMonitoringGeofences] 

2019-08-25 12:09:17.702 🔴-[TSLocationManager stopUpdatingLocation] 

2019-08-25 12:09:17.702 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF

2019-08-25 12:09:17.702 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] 

2019-08-25 12:09:17.851 ℹ️-[TSConfig persist] 

2019-08-25 12:09:35.512 ℹ️-[TSLocationManager on:success:failure:] location

2019-08-25 12:09:35.512 ℹ️-[TSLocationManager on:success:failure:] http

2019-08-25 12:09:35.514 ℹ️-[TSLocationManager on:success:failure:] heartbeat

2019-08-25 12:09:35.517 ⚠️-[TSLocationManager log:message:] #ready already called.  Redirecting to #setConfig

2019-08-25 12:09:35.518 ℹ️-[TSConfig persist] 

2019-08-25 12:09:35.523 🔵-[TSLocationManager getCurrentPosition:] 

2019-08-25 12:09:35.523 🎾-[LocationManager startUpdatingLocation] ON

2019-08-25 12:09:35.524 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:09:35.525 ℹ️+[LocationAuthorization run:onCancel:] status: 0

2019-08-25 12:09:35.525 🔵+[LocationAuthorization run:onCancel:] Request: requestAlwaysAuthorization

2019-08-25 12:09:35.870 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager start] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:35.870 ℹ️-[TSLocationManager doStart:] trackingMode: 1

2019-08-25 12:09:35.870 ℹ️-[TSConfig persist] 

2019-08-25 12:09:35.873 🎾-[TSGeofenceManager start] 

2019-08-25 12:09:35.874 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:35.875 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:35.875 🎾-[SOMotionDetector startDetection] 

2019-08-25 12:09:35.875 🔵-[TSLocationManager setPace:] 0

2019-08-25 12:09:35.881 ℹ️+[LocationAuthorization run:onCancel:] status: 0

2019-08-25 12:09:35.881 🔵+[LocationAuthorization run:onCancel:] Request: requestAlwaysAuthorization

2019-08-25 12:09:35.880 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-25 12:09:35.893 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON

2019-08-25 12:09:37.062 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates

2019-08-25 12:09:37.109 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:38.361 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:09:38.375 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:09:38.414 ℹ️-[TSConfig persist] 

2019-08-25 12:09:38.416 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3

2019-08-25 12:09:38.428 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-25 12:09:38.434 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-25 12:09:38.435 
📍<+40.06497816,-75.57317785> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:09:36 PM Eastern Daylight Time

2019-08-25 12:09:38.435 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 1.8s
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:38.435 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+40.06497816,-75.57317785> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:09:36 PM Eastern Daylight Time

2019-08-25 12:09:38.436 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 25

2019-08-25 12:09:38.437 🔴-[TSLocationManager stopUpdatingLocation] 

2019-08-25 12:09:38.437 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-25 12:09:38.438 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 

2019-08-25 12:09:38.445 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 4022F6E1-9184-4519-A1FB-3F5A1AD5200A

2019-08-25 12:09:38.445 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:38.445 ✅-[BackgroundTaskManager createBackgroundTask] 5

2019-08-25 12:09:38.453 ✅-[TSHttpService schedulePost:] LOCKED: 4022F6E1-9184-4519-A1FB-3F5A1AD5200A

2019-08-25 12:09:38.625 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:09:38.626 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:09:38.644 
📍<+40.06497816,-75.57317785> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:09:36 PM Eastern Daylight Time

2019-08-25 12:09:38.644 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 3
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:38.664 
📍<+40.06497816,-75.57317785> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:09:38 PM Eastern Daylight Time

2019-08-25 12:09:38.664 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 2 of 3
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:38.808 
📍<+40.06497820,-75.57318212> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:09:38 PM Eastern Daylight Time

2019-08-25 12:09:38.808 🔴-[LocationManager stopUpdatingLocation] OFF

2019-08-25 12:09:38.808 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 3 of 3
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:38.808 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-25 12:09:39.304 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-25 12:09:39.312 ✅-[TSHttpService post:error:] DESTROY: 4022F6E1-9184-4519-A1FB-3F5A1AD5200A

2019-08-25 12:09:39.312 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:09:39.312 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 5 OF (
    5
)

2019-08-25 12:09:59.538 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:00.485 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:01.117 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:02.696 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:03.647 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:08.696 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:13.116 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:14.703 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:16.917 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:18.507 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:19.767 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:21.031 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:21.653 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:24.185 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:25.133 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:27.365 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:30.512 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:31.145 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:34.282 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:35.546 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:10:37.445 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:38.390 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:39.655 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:40.920 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:43.448 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:49.138 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:10:51.980 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:11:30.870 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:11:30.870 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-25 12:11:35.567 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:11:40.872 🎾-[LocationManager requestLocation] ONESHOT

2019-08-25 12:11:45.055 
📍<+40.06477120,-75.57328938> +/- 10.00m (speed 0.70 mps / course 138.52) @ 8/25/19, 12:11:45 PM Eastern Daylight Time

2019-08-25 12:11:45.055 🔴-[LocationManager stopUpdatingLocation] OFF

2019-08-25 12:11:45.056 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:11:45.056 🔵-[TSLocationManager onUpdateState:location:type:] Location still within stationaryRadius (25 m) Δd: 24 m.  Motion-trigger ignored.

2019-08-25 12:11:45.057 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-25 12:11:55.058 🎾-[LocationManager requestLocation] ONESHOT

2019-08-25 12:11:55.068 
📍<+40.06480590,-75.57322366> +/- 5.00m (speed 0.00 mps / course -1.00) @ 8/25/19, 12:11:51 PM Eastern Daylight Time

2019-08-25 12:11:55.068 🔴-[LocationManager stopUpdatingLocation] OFF

2019-08-25 12:11:55.068 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:11:55.068 🔵-[TSLocationManager onUpdateState:location:type:] Location still within stationaryRadius (25 m) Δd: 19 m.  Motion-trigger ignored.

2019-08-25 12:11:55.068 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-25 12:11:55.368 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-25 12:29:59.591 ℹ️-[TSLocationManager init] {
    activityRecognitionInterval = 10000;
    activityType = 1;
    autoSync = 1;
    autoSyncThreshold = 0;
    batchSync = 0;
    debug = 1;
    desiredAccuracy = "-1";
    desiredOdometerAccuracy = 100;
    didLaunchInBackground = 0;
    disableElasticity = 0;
    disableLocationAuthorizationAlert = 0;
    disableMotionActivityUpdates = 0;
    disableStopDetection = 0;
    distanceFilter = 50;
    elasticityMultiplier = 1;
    enableTimestampMeta = 0;
    enabled = 1;
    extras =     {
    };
    geofenceInitialTriggerEntry = 1;
    geofenceProximityRadius = 1000;
    geofenceTemplate = "";
    headers =     {
        "CUSTOM-TOKEN-KEY" = "customheadervalue";
    };
    heartbeatInterval = 60;
    httpRootProperty = location;
    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 = 5;
    logMaxDays = 3;
    maxBatchSize = "-1";
    maxDaysToPersist = 1;
    maxRecordsToPersist = "-1";
    method = POST;
    minimumActivityRecognitionConfidence = 70;
    odometer = 0;
    params =     {
    };
    pausesLocationUpdatesAutomatically = 0;
    persistMode = 2;
    preventSuspend = 0;
    schedule =     (
    );
    schedulerEnabled = 0;
    startOnBoot = 1;
    stationaryRadius = 25;
    stopAfterElapsedMinutes = "-1";
    stopDetectionDelay = 0;
    stopOnStationary = 0;
    stopOnTerminate = 0;
    stopTimeout = 1;
    trackingMode = 1;
    url = "customurl";
    useSignificantChangesOnly = 0;
}

2019-08-25 12:29:59.592 ℹ️-[TSDBLogger db_delete] maxAge: 259200

2019-08-25 12:29:59.592 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS

2019-08-25 12:29:59.594 ℹ️-[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)

2019-08-25 12:29:59.594 ℹ️-[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);

2019-08-25 12:29:59.632 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3

2019-08-25 12:29:59.640 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:29:59.661 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-25 12:29:59.680 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:29:59.681 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:29:59.710 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:29:59.710 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-25 12:29:59.886 ℹ️-[TSLocationManager on:success:failure:] location

2019-08-25 12:29:59.886 ℹ️-[TSLocationManager on:success:failure:] http

2019-08-25 12:29:59.887 ℹ️-[TSLocationManager on:success:failure:] heartbeat

2019-08-25 12:29:59.897 ℹ️-[TSConfig persist] 

2019-08-25 12:29:59.899 🔵-[TSLocationManager ready] 

2019-08-25 12:29:59.899 ℹ️-[TSLocationManager doStart:] trackingMode: 1

2019-08-25 12:29:59.900 ℹ️-[TSLocationManager loadLastOdometerLocation] <+40.06497816,-75.57317785> +/- -1.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:29:59 PM Eastern Daylight Time

2019-08-25 12:29:59.900 🎾-[TSGeofenceManager start] 

2019-08-25 12:29:59.901 🎾-[SOMotionDetector startDetection] 

2019-08-25 12:29:59.901 🔵-[TSLocationManager setPace:] 0

2019-08-25 12:29:59.903 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-25 12:29:59.904 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:29:59.905 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:29:59.906 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-25 12:29:59.907 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:29:59.908 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON

2019-08-25 12:29:59.985 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates

2019-08-25 12:29:59.987 
📍<+40.06503989,-75.57318931> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:29:52 PM Eastern Daylight Time

2019-08-25 12:29:59.987 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 7.3s
╚═══════════════════════════════════════════════════════════

2019-08-25 12:29:59.987 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location.  Retrying...

2019-08-25 12:29:59.987 
📍<+40.06503989,-75.57318931> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:29:59 PM Eastern Daylight Time

2019-08-25 12:29:59.987 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════

2019-08-25 12:29:59.988 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+40.06503989,-75.57318931> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/25/19, 12:29:59 PM Eastern Daylight Time

2019-08-25 12:29:59.988 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 25

2019-08-25 12:29:59.988 🔴-[TSLocationManager stopUpdatingLocation] 

2019-08-25 12:29:59.988 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-25 12:29:59.988 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 

2019-08-25 12:30:00.061 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: C286C280-021C-44AA-8270-BF633F4CE6C1

2019-08-25 12:30:00.064 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:30:00.065 ✅-[BackgroundTaskManager createBackgroundTask] 3

2019-08-25 12:30:00.073 ✅-[TSHttpService schedulePost:] LOCKED: C286C280-021C-44AA-8270-BF633F4CE6C1

2019-08-25 12:30:00.085 ℹ️-[TSConfig persist] 

2019-08-25 12:30:00.890 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-25 12:30:00.903 ✅-[TSHttpService post:error:] DESTROY: C286C280-021C-44AA-8270-BF633F4CE6C1

2019-08-25 12:30:00.903 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:30:00.904 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 3 OF (
    3
)

2019-08-25 12:30:16.629 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-25 12:30:16.659 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:31:56.702 🔵-[TSLocationManager onResume:] enabled? 1

2019-08-25 12:31:56.702 ℹ️-[LocationDAO purge:] 1

2019-08-25 12:31:56.710 ℹ️-[TSDBLogger db_save] Log committed

2019-08-25 12:31:56.733 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-25 12:31:56.733 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-25 12:32:05.218 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-25 12:32:25.418 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-25 12:57:50.540 ℹ️-[TSLocationManager init] {
    activityRecognitionInterval = 10000;
    activityType = 1;
    autoSync = 1;
    autoSyncThreshold = 0;
    batchSync = 0;
    debug = 1;
    desiredAccuracy = "-1";
    desiredOdometerAccuracy = 100;
    didLaunchInBackground = 0;
    disableElasticity = 0;
    disableLocationAuthorizationAlert = 0;
    disableMotionActivityUpdates = 0;
    disableStopDetection = 0;
    distanceFilter = 50;
    elasticityMultiplier = 1;
    enableTimestampMeta = 0;
    enabled = 1;
    extras =     {
    };
    geofenceInitialTriggerEntry = 1;
    geofenceProximityRadius = 1000;
    geofenceTemplate = "";
    headers =     {
        "CUSTOM-TOKEN-KEY" = "customTokenValue";
    };
    heartbeatInterval = 60;
    httpRootProperty = location;
    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 = 5;
    logMaxDays = 3;
    maxBatchSize = "-1";
    maxDaysToPersist = 1;
    maxRecordsToPersist = "-1";
    method = POST;
    minimumActivityRecognitionConfidence = 70;
    odometer = 0;
    params =     {
    };
    pausesLocationUpdatesAutomatically = 0;
    persistMode = 2;
    preventSuspend = 0;
    schedule =     (
    );
    schedulerEnabled = 0;
    startOnBoot = 1;
    stationaryRadius = 25;
    stopAfterElapsedMinutes = "-1";
    stopDetectionDelay = 0;
    stopOnStationary = 0;
    stopOnTerminate = 0;
    stopTimeout = 1;
    trackingMode = 1;
    url = "customUrl";
    useSignificantChangesOnly = 0;
}

2019-08-25 12:57:50.540 ℹ️-[TSDBLogger db_delete] maxAge: 259200

2019-08-25 12:57:50.541 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS

2019-08-25 12:57:50.543 ℹ️-[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)

2019-08-25 12:57:50.543 ℹ️-[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);

2019-08-25 12:57:50.580 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3

2019-08-25 12:57:50.590 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

@christocracy
Copy link
Member

christocracy commented Aug 26, 2019

This is a really bad idea. I have no idea what would happen on an iOS device booted in the background, since that's going to attempt to launch the mail app. On a sim, it's going to raise an exception immediately since the mail client isn't configured, which you'll catch((error) immediately. Don't do that. Use a UI button to execute emailLog instead of interrupting the plugin's crucial launch cycle.

this.platform.ready().then(() => {
      BackgroundGeolocation.emailLog('xyz@abc.com').then((success) => {
        console.log('[emailLog] success');
      }).catch((error) => {
        console.log('[emailLog] FAILURE: ', error);
      });

@jeya-duraisamy
Copy link
Author

@christocracy I will be changing to get it from click of a button. I will post the updated log after changing it.
But will that change the outcome though? Because I had the same issue even before adding emailLog.

@christocracy
Copy link
Member

christocracy commented Aug 26, 2019

If it works in the sim, the problem is your device (is wifi enabled?) or your environment (obstructions; mountains/building; cell towers).

@jeya-duraisamy
Copy link
Author

@christocracy Yes, wifi is enabled on the device and it definitely has internet connection in the route I drove now. Included here is the new log after moving emailLog to be trigger by user action.
App was killed at 16:53 and I opened it at 17:06, there was no location update between this time although I drove for 13 miles.

Logs
2019-08-26 16:23:09.582 ℹ️-[TSConfig persist] 

2019-08-26 16:23:09.585 🔵-[TSLocationManager ready] 

2019-08-26 16:23:09.593 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 0

2019-08-26 16:23:09.593 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 0

2019-08-26 16:23:09.593 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 0

2019-08-26 16:23:09.593 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 0

2019-08-26 16:23:09.603 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 0

2019-08-26 16:23:09.607 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager stop] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:09.607 ℹ️-[TSLocationManager clearLastOdometerLocation] 

2019-08-26 16:23:09.607 🔴-[TSGeofenceManager stop] 

2019-08-26 16:23:09.609 🔴-[TSGeofenceManager stopMonitoringGeofences] 

2019-08-26 16:23:09.610 🔴-[TSLocationManager stopUpdatingLocation] 

2019-08-26 16:23:09.610 🔴-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF

2019-08-26 16:23:09.611 🔴-[TSLocationManager stopMonitoringSignificantLocationChanges] 

2019-08-26 16:23:09.616 ℹ️-[TSConfig persist] 

2019-08-26 16:23:14.848 ℹ️-[TSLocationManager on:success:failure:] location

2019-08-26 16:23:14.849 ℹ️-[TSLocationManager on:success:failure:] http

2019-08-26 16:23:14.849 ℹ️-[TSLocationManager on:success:failure:] heartbeat

2019-08-26 16:23:14.849 ⚠️-[TSLocationManager log:message:] #ready already called.  Redirecting to #setConfig

2019-08-26 16:23:14.850 🔵-[TSLocationManager getCurrentPosition:] 

2019-08-26 16:23:14.850 🎾-[LocationManager startUpdatingLocation] ON

2019-08-26 16:23:14.850 ℹ️+[LocationAuthorization run:onCancel:] status: 0

2019-08-26 16:23:14.850 🔵+[LocationAuthorization run:onCancel:] Request: requestAlwaysAuthorization

2019-08-26 16:23:14.851 ℹ️-[TSConfig persist] 

2019-08-26 16:23:14.871 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager start] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:14.871 ℹ️-[TSLocationManager doStart:] trackingMode: 1

2019-08-26 16:23:14.871 ℹ️-[TSConfig persist] 

2019-08-26 16:23:14.903 🎾-[TSGeofenceManager start] 

2019-08-26 16:23:14.904 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:14.904 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:14.904 🎾-[SOMotionDetector startDetection] 

2019-08-26 16:23:14.904 🔵-[TSLocationManager setPace:] 0

2019-08-26 16:23:14.905 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-26 16:23:14.906 ℹ️+[LocationAuthorization run:onCancel:] status: 0

2019-08-26 16:23:14.906 🔵+[LocationAuthorization run:onCancel:] Request: requestAlwaysAuthorization

2019-08-26 16:23:14.908 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON

2019-08-26 16:23:16.035 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates

2019-08-26 16:23:16.041 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:17.088 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 16:23:17.101 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 16:23:17.101 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 16:23:17.102 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 16:23:17.106 ℹ️-[TSConfig persist] 

2019-08-26 16:23:17.108 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3

2019-08-26 16:23:17.112 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-26 16:23:17.117 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-26 16:23:17.121 
📍<+40.07742690,-75.41659272> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:23:16 PM Eastern Daylight Time

2019-08-26 16:23:17.121 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 1.0s
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:17.121 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+40.07742690,-75.41659272> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:23:16 PM Eastern Daylight Time

2019-08-26 16:23:17.121 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 25

2019-08-26 16:23:17.122 🔴-[TSLocationManager stopUpdatingLocation] 

2019-08-26 16:23:17.123 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-26 16:23:17.124 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 

2019-08-26 16:23:17.125 
📍<+40.07742690,-75.41659272> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:23:16 PM Eastern Daylight Time

2019-08-26 16:23:17.125 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 3
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:17.140 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: F2C0E824-DE31-4417-B5C5-D4B95C8E05E6

2019-08-26 16:23:17.140 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:17.140 ✅-[BackgroundTaskManager createBackgroundTask] 3

2019-08-26 16:23:17.147 ✅-[TSHttpService schedulePost:] LOCKED: F2C0E824-DE31-4417-B5C5-D4B95C8E05E6

2019-08-26 16:23:17.236 
📍<+40.07742648,-75.41659192> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:23:17 PM Eastern Daylight Time

2019-08-26 16:23:17.236 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 2 of 3
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:17.254 
📍<+40.07742654,-75.41659177> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:23:17 PM Eastern Daylight Time

2019-08-26 16:23:17.254 🔴-[LocationManager stopUpdatingLocation] OFF

2019-08-26 16:23:17.254 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 3 of 3
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:17.254 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-26 16:23:18.155 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-26 16:23:18.165 ✅-[TSHttpService post:error:] DESTROY: F2C0E824-DE31-4417-B5C5-D4B95C8E05E6

2019-08-26 16:23:18.165 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:18.165 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 3 OF (
    3
)

2019-08-26 16:23:20.356 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:21.101 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:23:24.154 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:25.106 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:28.289 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:35.250 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:37.474 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:23:40.104 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-26 16:23:40.118 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:30:30.393 🔵-[TSLocationManager onResume:] enabled? 1

2019-08-26 16:30:30.394 ℹ️-[LocationDAO purge:] 1

2019-08-26 16:30:30.402 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:30:30.402 ℹ️-[TSDBLogger db_delete] maxAge: 604800

2019-08-26 16:30:30.408 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:30:30.481 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:30:30.481 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:30:35.432 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:30:36.680 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:30:37.312 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:30:37.955 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:30:41.920 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-26 16:30:42.329 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:36:16.403 🔵-[TSLocationManager onResume:] enabled? 1

2019-08-26 16:36:16.406 ℹ️-[LocationDAO purge:] 1

2019-08-26 16:36:16.423 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:36:16.423 ℹ️-[TSDBLogger db_delete] maxAge: 604800

2019-08-26 16:36:16.489 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:36:16.563 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:36:16.563 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:36:18.179 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-26 16:36:18.194 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:40:29.665 🔵-[TSLocationManager onResume:] enabled? 1

2019-08-26 16:40:29.667 ℹ️-[LocationDAO purge:] 1

2019-08-26 16:40:29.676 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:40:29.676 ℹ️-[TSDBLogger db_delete] maxAge: 604800

2019-08-26 16:40:29.680 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:40:29.808 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:40:29.808 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:40:29.808 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:40:34.972 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:40:38.133 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:40:39.409 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:41:29.701 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:41:29.947 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-26 16:41:29.974 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:50:16.050 🔵-[TSHttpService init]_block_invoke Network: Cellular | Flags: WR -t-----

2019-08-26 16:50:16.057 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:16.058 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:50:16.058 ℹ️-[TSDBLogger db_delete] maxAge: 604800

2019-08-26 16:50:16.058 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:16.453 🔵-[TSLocationManager onResume:] enabled? 1

2019-08-26 16:50:16.454 ℹ️-[LocationDAO purge:] 1

2019-08-26 16:50:16.476 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:50:16.571 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:16.572 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:16.572 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:16.572 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 16:50:18.065 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:18.065 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 16:50:18.369 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:18.369 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 16:50:18.687 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:18.687 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 16:50:20.264 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:20.264 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 16:50:20.587 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:20.588 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 16:50:20.894 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:50:20.894 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 16:50:21.605 🔵-[TSLocationManager onSuspend:] enabled? 1)

2019-08-26 16:50:21.627 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:53:18.758 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:53:18.759 ℹ️-[TSDBLogger db_delete] maxAge: 604800

2019-08-26 16:53:18.761 🎾-[LocationManager requestLocation] ONESHOT

2019-08-26 16:53:18.842 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:18.873 🔵-[TSLocationManager locationManager:didExitRegion:] Exit stationary region

2019-08-26 16:53:18.873 🔵-[TSLocationManager setPace:] 1

2019-08-26 16:53:18.874 ℹ️-[TSConfig persist] 

2019-08-26 16:53:18.896 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-26 16:53:18.912 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-26 16:53:19.011 
📍<+40.07330990,-75.43105345> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:53:18 PM Eastern Daylight Time

2019-08-26 16:53:19.039 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: -1.0m | age: 0.2s
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:19.040 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+40.07330990,-75.43105345> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 4:53:18 PM Eastern Daylight Time

2019-08-26 16:53:19.042 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-26 16:53:19.042 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-26 16:53:19.044 ℹ️-[TSConfig persist] 

2019-08-26 16:53:19.052 🔵-[TSConfig incrementOdometer:] 1315.5

2019-08-26 16:53:19.067 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: A6109746-F4DE-452D-8737-6F49F13A6888

2019-08-26 16:53:19.070 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-26 16:53:19.084 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:19.090 ✅-[BackgroundTaskManager createBackgroundTask] 36

2019-08-26 16:53:19.109 ✅-[TSHttpService schedulePost:] LOCKED: A6109746-F4DE-452D-8737-6F49F13A6888

2019-08-26 16:53:22.159 
📍<+40.07261792,-75.43126146> +/- 5.00m (speed 30.87 mps / course 254.18) @ 8/26/19, 4:53:21 PM Eastern Daylight Time

2019-08-26 16:53:22.159 🔴-[LocationManager stopUpdatingLocation] OFF

2019-08-26 16:53:22.160 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:22.163 
📍<+40.07261792,-75.43126146> +/- 5.00m (speed 30.87 mps / course 254.18) @ 8/26/19, 4:53:21 PM Eastern Daylight Time

2019-08-26 16:53:22.163 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 50.0m | age: 0.2s
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:22.163 🔵-[TSLocationManager locationManager:didUpdateLocations:] Updated distanceFilter, new: 350.000000, old: 50.000000

2019-08-26 16:53:22.164 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-26 16:53:22.165 ℹ️-[TSConfig persist] 

2019-08-26 16:53:22.175 🔵-[TSConfig incrementOdometer:] 1394.4

2019-08-26 16:53:24.958 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-26 16:53:24.996 ✅-[TSHttpService post:error:] DESTROY: A6109746-F4DE-452D-8737-6F49F13A6888

2019-08-26 16:53:24.997 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:24.999 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 36 OF (
    36
)

2019-08-26 16:53:25.005 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 1FA7980F-4ECC-427F-8ABE-44E9E60E5A63

2019-08-26 16:53:25.005 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:25.005 ✅-[BackgroundTaskManager createBackgroundTask] 39

2019-08-26 16:53:25.014 ✅-[TSHttpService schedulePost:] LOCKED: 1FA7980F-4ECC-427F-8ABE-44E9E60E5A63

2019-08-26 16:53:25.319 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-26 16:53:25.348 ✅-[TSHttpService post:error:] DESTROY: 1FA7980F-4ECC-427F-8ABE-44E9E60E5A63

2019-08-26 16:53:25.349 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:25.349 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 39 OF (
    39
)

2019-08-26 16:53:30.205 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:34.043 
📍<+40.07184176,-75.43553113> +/- 5.00m (speed 30.42 mps / course 259.91) @ 8/26/19, 4:53:33 PM Eastern Daylight Time

2019-08-26 16:53:34.095 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 350.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:34.095 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-26 16:53:34.095 ℹ️-[TSConfig persist] 

2019-08-26 16:53:34.099 🔵-[TSConfig incrementOdometer:] 1768.6

2019-08-26 16:53:34.153 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: BE10453F-1AB6-4C04-B09D-979BEE178D99

2019-08-26 16:53:34.154 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:34.157 ✅-[BackgroundTaskManager createBackgroundTask] 42

2019-08-26 16:53:34.327 ✅-[TSHttpService schedulePost:] LOCKED: BE10453F-1AB6-4C04-B09D-979BEE178D99

2019-08-26 16:53:34.771 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-26 16:53:34.785 ✅-[TSHttpService post:error:] DESTROY: BE10453F-1AB6-4C04-B09D-979BEE178D99

2019-08-26 16:53:34.785 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 16:53:34.785 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 42 OF (
    42
)

2019-08-26 16:53:39.403 ℹ️-[TSDBLogger db_save] Log committed

2019-08-26 16:53:39.403 🔵-[TSLocationManager onAppTerminate] stopOnTerminate? 0

2019-08-26 16:53:39.403 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 189

2019-08-26 17:06:10.873 ℹ️-[TSDBLogger db_delete] maxAge: 259200

2019-08-26 17:06:10.876 ℹ️-[TSLocationManager init] {
    activityRecognitionInterval = 10000;
    activityType = 1;
    autoSync = 1;
    autoSyncThreshold = 0;
    batchSync = 0;
    debug = 1;
    desiredAccuracy = "-1";
    desiredOdometerAccuracy = 100;
    didLaunchInBackground = 0;
    disableElasticity = 0;
    disableLocationAuthorizationAlert = 0;
    disableMotionActivityUpdates = 0;
    disableStopDetection = 0;
    distanceFilter = 50;
    elasticityMultiplier = 1;
    enableTimestampMeta = 0;
    enabled = 1;
    extras =     {
    };
    geofenceInitialTriggerEntry = 1;
    geofenceProximityRadius = 1000;
    geofenceTemplate = "";
    headers =     {
        "DRIVER-TOKEN" = "customvalue";
    };
    heartbeatInterval = 60;
    httpRootProperty = location;
    httpTimeout = 60000;
    iOSHasWarnedLocationServicesOff = 0;
    isFirstBoot = 0;
    isMoving = 1;
    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 = 5;
    logMaxDays = 3;
    maxBatchSize = "-1";
    maxDaysToPersist = 1;
    maxRecordsToPersist = "-1";
    method = POST;
    minimumActivityRecognitionConfidence = 70;
    odometer = "1768.61392862721";
    params =     {
    };
    pausesLocationUpdatesAutomatically = 0;
    persistMode = 2;
    preventSuspend = 0;
    schedule =     (
    );
    schedulerEnabled = 0;
    startOnBoot = 1;
    stationaryRadius = 25;
    stopAfterElapsedMinutes = "-1";
    stopDetectionDelay = 0;
    stopOnStationary = 0;
    stopOnTerminate = 0;
    stopTimeout = 1;
    trackingMode = 1;
    url = "customurl";
    useSignificantChangesOnly = 0;
}

2019-08-26 17:06:10.880 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS

2019-08-26 17:06:10.887 ℹ️-[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)

2019-08-26 17:06:10.887 ℹ️-[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);

2019-08-26 17:06:10.933 ℹ️-[TSLocationManager on:success:failure:] location

2019-08-26 17:06:10.940 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3

2019-08-26 17:06:10.947 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 17:06:10.947 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 17:06:10.947 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 17:06:10.947 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3

2019-08-26 17:06:10.947 ℹ️-[TSLocationManager on:success:failure:] http

2019-08-26 17:06:10.947 ℹ️-[TSLocationManager on:success:failure:] heartbeat

2019-08-26 17:06:10.954 ℹ️-[TSConfig persist] 

2019-08-26 17:06:10.959 ℹ️-[TSConfig persist] 

2019-08-26 17:06:10.961 🔵-[TSLocationManager ready] 

2019-08-26 17:06:10.961 ℹ️-[TSLocationManager doStart:] trackingMode: 1

2019-08-26 17:06:10.966 ℹ️-[TSLocationManager loadLastOdometerLocation] <+40.07184176,-75.43553113> +/- -1.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 5:06:10 PM Eastern Daylight Time

2019-08-26 17:06:10.966 🎾-[TSGeofenceManager start] 

2019-08-26 17:06:10.967 🎾-[SOMotionDetector startDetection] 

2019-08-26 17:06:10.967 🔵-[TSLocationManager setPace:] 0

2019-08-26 17:06:10.972 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON

2019-08-26 17:06:10.982 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-26 17:06:10.983 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:10.983 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:10.991 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2019-08-26 17:06:10.992 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON

2019-08-26 17:06:10.995 
📍<+40.06514843,-75.57313555> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 5:06:01 PM Eastern Daylight Time

2019-08-26 17:06:10.995 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 9.3s
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:10.995 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location.  Retrying...

2019-08-26 17:06:10.999 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates

2019-08-26 17:06:11.025 
📍<+40.06514843,-75.57313555> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 5:06:10 PM Eastern Daylight Time

2019-08-26 17:06:11.025 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 0.3s
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:11.025 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+40.06514843,-75.57313555> +/- 65.00m (speed -1.00 mps / course -1.00) @ 8/26/19, 5:06:10 PM Eastern Daylight Time

2019-08-26 17:06:11.025 ℹ️-[TSConfig persist] 

2019-08-26 17:06:11.026 🔵-[TSConfig incrementOdometer:] 13531.2

2019-08-26 17:06:11.027 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 25

2019-08-26 17:06:11.027 🔴-[TSLocationManager stopUpdatingLocation] 

2019-08-26 17:06:11.027 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

2019-08-26 17:06:11.028 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 

2019-08-26 17:06:11.034 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: D773BA54-5C9B-45D4-87F6-32A24A4EEDA7

2019-08-26 17:06:11.034 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:11.035 ✅-[BackgroundTaskManager createBackgroundTask] 4

2019-08-26 17:06:11.051 ✅-[TSHttpService schedulePost:] LOCKED: D773BA54-5C9B-45D4-87F6-32A24A4EEDA7

2019-08-26 17:06:11.169 ℹ️-[TSConfig persist] 

2019-08-26 17:06:11.194 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:11.194 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 17:06:11.525 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:11.525 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 17:06:11.836 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:11.837 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 17:06:12.155 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:12.155 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 17:06:12.498 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:12.498 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 17:06:12.820 🔵-[TSHttpService doPost:] HTTP Response: 200

2019-08-26 17:06:12.830 ✅-[TSHttpService post:error:] DESTROY: D773BA54-5C9B-45D4-87F6-32A24A4EEDA7

2019-08-26 17:06:12.831 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:12.831 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 4 OF (
    4
)

2019-08-26 17:06:14.367 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:14.997 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:14.997 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 17:06:15.632 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:15.632 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 17:06:15.956 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:15.957 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 17:06:16.263 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:16.264 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 17:06:17.044 🔵-[TSHttpService init]_block_invoke Network: WiFi | Flags: -R -------

2019-08-26 17:06:17.044 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:17.045 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:18.485 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:19.435 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:20.385 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:20.385 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

2019-08-26 17:06:20.700 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:20.700 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Query location-state will trigger in 10 seconds...

2019-08-26 17:06:21.655 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2019-08-26 17:06:21.655 ℹ️-[TSLocationManager resetMotionTriggerTimer] 

@christocracy
Copy link
Member

Clone the SampleApp repo and build it to your device. Do not look at the code, just clone and install on device. Use the "Advanced App" and tell me the username you select so I can observe your results.

@jeya-duraisamy
Copy link
Author

@christocracy I will do this in couple of days and give you the username.

@jeya-duraisamy
Copy link
Author

jeya-duraisamy commented Sep 8, 2019

@christocracy User name is jeya-duraisamy5.
I cloned the demo app before this also, killed the app and it got enabled after I drove for little while. Thinking that this may be an issue with the new version of Ionic & Angular, I created a helloworld app with most recent Ionic and it worked on that also.
So there must be some dependency / conflict with what is in our project. Below is the package.json for our project. Is there anything in this that could cause a problem?

{
  "name": "myApp",
  "version": "1.2.3",
  "author": "Author",
  "homepage": "https://www.google.com",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.13",
    "@angular/common": "^7.2.13",
    "@angular/core": "^7.2.13",
    "@angular/forms": "^7.2.13",
    "@angular/http": "^7.2.13",
    "@angular/platform-browser": "^7.2.13",
    "@angular/platform-browser-dynamic": "^7.2.13",
    "@angular/router": "^7.2.13",
    "@fortawesome/angular-fontawesome": "^0.3.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.17",
    "@fortawesome/free-solid-svg-icons": "^5.8.1",
    "@ionic-native/camera": "^5.5.0",
    "@ionic-native/core": "5.1.0",
    "@ionic-native/keyboard": "^5.5.0",
    "@ionic-native/photo-viewer": "^5.5.0",
    "@ionic-native/screen-orientation": "^5.7.0",
    "@ionic-native/sim": "^5.5.0",
    "@ionic-native/splash-screen": "5.1.0",
    "@ionic-native/status-bar": "5.1.0",
    "@ionic/angular": "4.0.0-beta.19",
    "@ionic/storage": "^2.2.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "angular2-signaturepad": "^2.8.0",
    "cordova-android": "8.0.0",
    "cordova-background-geolocation-lt": "3.2.0",
    "cordova-ios": "5.0.1",
    "cordova-plugin-background-fetch": "^5.5.0",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-cocoalumberjack": "0.0.4",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.4.1",
    "cordova-plugin-screen-orientation": "3.0.1",
    "cordova-plugin-sim": "^1.3.3",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-sqlite-storage": "^3.2.0",
    "core-js": "^2.6.9",
    "es6-promise-plugin": "^4.2.2",
    "hammerjs": "^2.0.8",
    "ionic": "^4.12.0",
    "rxjs": "~6.3.3",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.10.0",
    "@angular-devkit/build-angular": "^0.13.8",
    "@angular-devkit/core": "^7.3.8",
    "@angular-devkit/schematics": "^7.3.8",
    "@angular/cli": "^7.3.8",
    "@angular/compiler": "^7.2.13",
    "@angular/compiler-cli": "^7.2.13",
    "@angular/language-service": "^7.2.13",
    "@ionic/angular-toolkit": "^1.5.1",
    "@types/jasmine": "^2.8.16",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^10.14.5",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.6",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.2",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.1.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-sqlite-storage": {},
      "cordova-plugin-sim": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-screen-orientation": {},
      "cordova-background-geolocation-lt": {
        "GOOGLE_API_VERSION": "16.+",
        "APPCOMPAT_VERSION": "28.+",
        "OKHTTP_VERSION": "3.12.+",
        "EVENTBUS_VERSION": "3.0.0",
        "BACKGROUND_MODE_LOCATION": "<string>location</string>"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

@nijeshw
Copy link

nijeshw commented Sep 10, 2019

@christocracy I'm also facing same issue. Your Sample App is with ionic 3 and it works good, but tracking not working (iOS) when app is closed in ionic 4 in my app.

@christocracy
Copy link
Member

The plugin doesn't know or care if you use Ionic 3, 4 or even if you don't use Ionic at all. Ionic version has no effect on the behaviour of the plugin.

See wiki Debugging.

@nijeshw
Copy link

nijeshw commented Sep 11, 2019

@christocracy I checked the log in Xcode. When app is terminated TSBackgroundFetch stop Updating Location

    activityRecognitionInterval = 10000;
    activityType = 1;
    autoSync = 1;
    autoSyncThreshold = 0;
    batchSync = 0;
    debug = 1;
    desiredAccuracy = "-1";
    desiredOdometerAccuracy = 100;
    didLaunchInBackground = 0;
    disableElasticity = 0;
    disableLocationAuthorizationAlert = 0;
    disableMotionActivityUpdates = 0;
    disableStopDetection = 0;
    distanceFilter = 10;
    elasticityMultiplier = 1;
    enableTimestampMeta = 0;
    enabled = 1;
    extras =     {
    };
    geofenceInitialTriggerEntry = 1;
    geofenceProximityRadius = 1000;
    geofenceTemplate = "";
    headers =     {
    };
    heartbeatInterval = 60;
    httpRootProperty = location;
    httpTimeout = 60000;
    iOSHasWarnedLocationServicesOff = 0;
    isFirstBoot = 0;
    isMoving = 1;
    lastLocationAuthorizationStatus = 3;
    locationAuthorizationAlert =     {
        cancelButton = Cancel;
        instructions = "To use background location, you must enable '{locationAuthor
ℹ️-[TSLocationManager init] {
    activityRecognitionInterval = 10000;
    activityType = 1;
    autoSync = 1;
    autoSyncThreshold = 0;
    batchSync = 0;
    debug = 1;
    desiredAccuracy = "-1";
    desiredOdometerAccuracy = 100;
    didLaunchInBackground = 0;
    disableElasticity = 0;
    disableLocationAuthorizationAlert = 0;
    disableMotionActivityUpdates = 0;
    disableStopDetection = 0;
    distanceFilter = 10;
    elasticityMultiplier = 1;
    enableTimestampMeta = 0;
    enabled = 1;
    extras =     {
    };
    geofenceInitialTriggerEntry = 1;
    geofenceProximityRadius = 1000;
    geofenceTemplate = "";
    headers =     {
    };
    heartbeatInterval = 60;
    httpRootProperty = location;
    httpTimeout = 60000;
    iOSHasWarnedLocationServicesOff = 0;
    isFirstBoot = 0;
    isMoving = 1;
    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 = 5;
    logMaxDays = 3;
    maxBatchSize = "-1";
    maxDaysToPersist = 0;
    maxRecordsToPersist = 0;
    method = POST;
    minimumActivityRecognitionConfidence = 70;
    odometer = 0;
    params =     {
        device =         {
            framework = Cordova;
            manufacturer = Apple;
            model = "iPhone8,2";
            platform = iOS;
            uuid = "iPhone8-2";
            version = "12.4.1";
        };
    };
    pausesLocationUpdatesAutomatically = 0;
    persistMode = 2;
    preventSuspend = 0;
    schedule =     (
    );
    schedulerEnabled = 0;
    startOnBoot = 1;
    stationaryRadius = 25;
    stopAfterElapsedMinutes = "-1";
    stopDetectionDelay = 0;
    stopOnStationary = 0;
    stopOnTerminate = 0;
    stopTimeout = 5;
    trackingMode = 1;
    url = "http://tracker.transistorsoft.com/locations/nigesh";
    useSignificantChangesOnly = 0;
}
✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS
2019-09-11 12:04:16.588900+0530 BeamaBuddy[683:175970] ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS
2019-09-11 12:04:16.589043+0530 BeamaBuddy[683:175970] ℹ️-[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)
ℹ️-[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)
ℹ️-[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);
2019-09-11 12:04:16.596204+0530 BeamaBuddy[683:175837] ℹ️-[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);
ℹ️-[TSDBLogger db_delete] maxAge: 259200
2019-09-11 12:04:16.601036+0530 BeamaBuddy[683:175837] ℹ️-[TSDBLogger db_delete] maxAge: 259200
ℹ️-[TSLocationManager on:success:failure:] location
2019-09-11 12:04:16.618519+0530 BeamaBuddy[683:175837] ℹ️-[TSLocationManager on:success:failure:] location
ℹ️-[TSLocationManager on:success:failure:] motionchange
2019-09-11 12:04:16.623154+0530 BeamaBuddy[683:175837] ℹ️-[TSLocationManager on:success:failure:] motionchange
ℹ️-[TSLocationManager on:success:failure:] activitychange
2019-09-11 12:04:16.629476+0530 BeamaBuddy[683:175867] ℹ️-[TSLocationManager on:success:failure:] activitychange
ℹ️-[TSGeofenceManager onGeofence:] 
2019-09-11 12:04:16.630312+0530 BeamaBuddy[683:175867] ℹ️-[TSGeofenceManager onGeofence:] 
ℹ️-[TSLocationManager on:success:failure:] http
2019-09-11 12:04:16.634101+0530 BeamaBuddy[683:175974] ℹ️-[TSLocationManager on:success:failure:] http
2019-09-11 12:04:16.635504+0530 BeamaBuddy[683:175685] THREAD WARNING: ['BackgroundGeolocation'] took '14.750977' ms. Plugin should use a background thread.
2019-09-11 12:04:16.636335+0530 BeamaBuddy[683:175685] [TSBackgroundFetch configure]: {
    enableHeadless = 1;
    minimumFetchInterval = 15;
    requiredNetworkType = 0;
    requiresBatteryNotLow = 0;
    requiresCharging = 0;
    requiresDeviceIdle = 0;
    requiresStorageNotLow = 0;
    startOnBoot = 1;
    stopOnTerminate = 0;
}
ℹ️-[TSLocationManager on:success:failure:] enabledchange
2019-09-11 12:04:16.638317+0530 BeamaBuddy[683:175976] ℹ️-[TSLocationManager on:success:failure:] enabledchange
ℹ️-[TSHttpService onConnectivityChange:] 
2019-09-11 12:04:16.645191+0530 BeamaBuddy[683:175976] ℹ️-[TSHttpService onConnectivityChange:] 
🔵-[TSLocationManager ready] 
2019-09-11 12:04:16.645551+0530 BeamaBuddy[683:175974] 🔵-[TSLocationManager ready] 
ℹ️-[TSLocationManager doStart:] trackingMode: 1
2019-09-11 12:04:16.645876+0530 BeamaBuddy[683:175976] ℹ️-[TSLocationManager doStart:] trackingMode: 1
ℹ️-[TSLocationManager loadLastOdometerLocation] <+11.11281651,+77.03574942> +/- -1.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:16 PM India Standard Time
2019-09-11 12:04:16.646136+0530 BeamaBuddy[683:175974] ℹ️-[TSLocationManager loadLastOdometerLocation] 2019-09-11 12:04:16.684161+0530 BeamaBuddy[683:175685] [TSBackgroundFetch addListener]: TSLocationManager
<+11.11281651,+77.03574942> +/- -1.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:16 PM India Standard Time
2019-09-11 12:04:16.687858+0530 BeamaBuddy[683:175685] [TSBackgroundFetch start]
🎾-[TSGeofenceManager start] 
2019-09-11 12:04:16.688424+0530 BeamaBuddy[683:175974] 🎾-[TSGeofenceManager start] 
🎾-[SOMotionDetector startDetection] 
2019-09-11 12:04:16.689473+0530 BeamaBuddy[683:175976] 🎾-[SOMotionDetector startDetection] 
🔵-[TSLocationManager setPace:] 1
2019-09-11 12:04:16.691202+0530 BeamaBuddy[683:175685] [TSBackgroundFetch addListener]: CDVBackgroundFetch
2019-09-11 12:04:16.691250+0530 BeamaBuddy[683:175974] 🔵-[TSLocationManager setPace:] 1
2019-09-11 12:04:16.691255+0530 BeamaBuddy[683:175685] [TSBackgroundFetch start]
🎾-[SOMotionDetector startShakeDetection:] sample-rate: 0.2 | M7 DISABLED
2019-09-11 12:04:16.692020+0530 BeamaBuddy[683:175976] 🎾-[SOMotionDetector startShakeDetection:] sample-rate: 0.2 | M7 DISABLED
🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
2019-09-11 12:04:16.795429+0530 BeamaBuddy[683:175868] 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3
2019-09-11 12:04:16.795609+0530 BeamaBuddy[683:175977] 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3
🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3
2019-09-11 12:04:16.795755+0530 BeamaBuddy[683:175868] 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3
🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3
2019-09-11 12:04:16.795887+0530 BeamaBuddy[683:175868] 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3
🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3
2019-09-11 12:04:16.796017+0530 BeamaBuddy[683:175976] 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3
🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3
2019-09-11 12:04:16.800501+0530 BeamaBuddy[683:175976] 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:16.801865+0530 BeamaBuddy[683:175971] 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚════════════════════════════════════════════════════════════════════════════════════════════

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚══════════════════════════════════════════════════════════\342═
2019-09-11 12:04:16.803836+0530 BeamaBuddy[683:175976] 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════
ℹ️+[LocationAuthorization run:onCancel:] status: 3
2019-09-11 12:04:16.803995+0530 BeamaBuddy[683:175977] ℹ️+[LocationAuthorization run:onCancel:] status: 3
🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON
2019-09-11 12:04:16.807060+0530 BeamaBuddy[683:175976] 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON
ℹ️+[LocationAuthorization run:onCancel:] status: 3
2019-09-11 12:04:16.807209+0530 BeamaBuddy[683:175971] ℹ️+[LocationAuthorization run:onCancel:] status: 3

📍<+11.11281292,+77.03572426> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:15 PM India Standard Time
2019-09-11 12:04:16.807401+0530 BeamaBuddy[683:175971] 
📍<+11.11281292,+77.03572426> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:15 PM India Standard Time

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: -1.0m | age: 0.9s
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:16.807584+0530 BeamaBuddy[683:175977] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: -1.0m | age: 0.9s
╚═══════════════════════════════════════════════════════════
✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+11.11281292,+77.03572426> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:15 PM India Standard Time
2019-09-11 12:04:16.810628+0530 BeamaBuddy[683:175971] ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+11.11281292,+77.03572426> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:15 PM India Standard Time
🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
2019-09-11 12:04:16.813477+0530 BeamaBuddy[683:175976] 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:04:16.813622+0530 BeamaBuddy[683:175977] 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 
2019-09-11 12:04:16.813808+0530 BeamaBuddy[683:175977] 🎾-[TSLocationManager startMonitoringSignificantLocationChanges] 
ℹ️+[LocationAuthorization run:onCancel:] status: 3
2019-09-11 12:04:16.813975+0530 BeamaBuddy[683:175977] ℹ️+[LocationAuthorization run:onCancel:] status: 3
🔴-[SOMotionDetector stopShakeDetection] OFF
2019-09-11 12:04:16.821715+0530 BeamaBuddy[683:175873] 🔴-[SOMotionDetector stopShakeDetection] OFF
✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates
2019-09-11 12:04:16.822233+0530 BeamaBuddy[683:175873] ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:16.826043+0530 BeamaBuddy[683:175969] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:16.826263+0530 BeamaBuddy[683:175873] 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds...
🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds...
2019-09-11 12:04:17.014440+0530 BeamaBuddy[683:175685] [connectivitychange] - connected? true
2019-09-11 12:04:17.014707+0530 BeamaBuddy[683:175685] [location] - [object Object]
2019-09-11 12:04:17.014875+0530 BeamaBuddy[683:175685] BG ready state [object Object]
2019-09-11 12:04:17.015341+0530 BeamaBuddy[683:175685] [motionchange] - true [object Object]
2019-09-11 12:04:17.015486+0530 BeamaBuddy[683:175685] [location] - [object Object]
2019-09-11 12:04:17.015620+0530 BeamaBuddy[683:175685] [activitychange] - still 100
2019-09-11 12:04:17.177622+0530 BeamaBuddy[683:175685] this.currentLocation {"lat": 11.112813714927102, "lng": 77.03572349832106}
2019-09-11 12:04:18.816298+0530 BeamaBuddy[683:175685] getting userprofile error Server error
2019-09-11 12:04:20.800623+0530 BeamaBuddy[683:175685] user detail not exist doing second attempt
2019-09-11 12:04:20.805688+0530 BeamaBuddy[683:175685] remainingDays 240
🔵-[TSLocationManager beginStopDetection] ⏲Stop-timeout engaged: 300 s...
2019-09-11 12:04:26.827601+0530 BeamaBuddy[683:175969] 🔵-[TSLocationManager beginStopDetection] ⏲Stop-timeout engaged: 300 s...
2019-09-11 12:04:26.837969+0530 BeamaBuddy[683:175978] ✅-[BackgroundTaskManager createBackgroundTask] 2
✅-[BackgroundTaskManager createBackgroundTask] 2
🎾-[BackgroundTaskManager startKeepAlive] 
2019-09-11 12:04:26.841898+0530 BeamaBuddy[683:175867] 🎾-[BackgroundTaskManager startKeepAlive] 
🔴-[TSLocationManager stopUpdatingLocation] 
2019-09-11 12:04:26.844536+0530 BeamaBuddy[683:175978] 🔴-[TSLocationManager stopUpdatingLocation] 
2019-09-11 12:04:38.351240+0530 BeamaBuddy[683:175685] CDVIonicKeyboard: updating frame
2019-09-11 12:04:40.248760+0530 BeamaBuddy[683:175685] CDVIonicKeyboard: updating frame
2019-09-11 12:04:43.128071+0530 BeamaBuddy[683:175867] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x281cab7a0, domain=1, instance=1>
🔵-[TSHttpService init]_block_invoke Network: Cellular | Flags: WR -t-----
2019-09-11 12:04:48.786185+0530 BeamaBuddy[683:175969] 🔵-[TSHttpService init]_block_invoke Network: Cellular | Flags: WR -t-----

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:48.794308+0530 BeamaBuddy[683:176220] 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:48.797972+0530 BeamaBuddy[683:175969] 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:48.799698+0530 BeamaBuddy[683:175867] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C5.1:2][0x106406950] get output frames failed, state 8196
2019-09-11 12:04:48.800044+0530 BeamaBuddy[683:175867] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C5.1:2][0x106406950] get output frames failed, state 8196
2019-09-11 12:04:48.802046+0530 BeamaBuddy[683:175867] TIC Read Status [5:0x0]: 1:57
2019-09-11 12:04:48.802101+0530 BeamaBuddy[683:175867] TIC Read Status [5:0x0]: 1:57
2019-09-11 12:04:48.802581+0530 BeamaBuddy[683:175867] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x10640ed20] get output frames failed, state 8196
2019-09-11 12:04:48.802771+0530 BeamaBuddy[683:175867] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x10640ed20] get output frames failed, state 8196
2019-09-11 12:04:48.803281+0530 BeamaBuddy[683:175867] TIC Read Status [3:0x0]: 1:57
2019-09-11 12:04:48.803312+0530 BeamaBuddy[683:175867] TIC Read Status [3:0x0]: 1:57
2019-09-11 12:04:48.807034+0530 BeamaBuddy[683:175685] [connectivitychange] - connected? true

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:59.373167+0530 BeamaBuddy[683:176220] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | on_foot/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════
🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
2019-09-11 12:04:59.378414+0530 BeamaBuddy[683:176220] 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
🔴-[BackgroundTaskManager stopKeepAlive] 
2019-09-11 12:04:59.383564+0530 BeamaBuddy[683:175867] 🔴-[BackgroundTaskManager stopKeepAlive] 
ℹ️-[TSLocationManager resetStopTimeoutTimer] 
2019-09-11 12:04:59.386100+0530 BeamaBuddy[683:176336] ℹ️-[TSLocationManager resetStopTimeoutTimer] 
ℹ️+[LocationAuthorization run:onCancel:] status: 3
2019-09-11 12:04:59.405384+0530 BeamaBuddy[683:176336] ℹ️+[LocationAuthorization run:onCancel:] status: 3
✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 2 OF (
    2
)
2019-09-11 12:04:59.410659+0530 BeamaBuddy[683:175978] ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 2 OF (
    2
)

📍<+11.11281815,+77.03572745> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:27 PM India Standard Time
2019-09-11 12:04:59.423463+0530 BeamaBuddy[683:175867] 
📍<+11.11281815,+77.03572745> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:27 PM India Standard Time

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 31.8s
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:59.430221+0530 BeamaBuddy[683:175867] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 31.8s
╚═══════════════════════════════════════════════════════════
🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:04:59.479767+0530 BeamaBuddy[683:176353] 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0

📍<+11.11281815,+77.03572745> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:36 PM India Standard Time
2019-09-11 12:04:59.479932+0530 BeamaBuddy[683:176342] 
📍<+11.11281815,+77.03572745> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:04:36 PM India Standard Time

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 22.8s
╚═══════════════════════════════════════════════════════════
2019-09-11 12:04:59.480095+0530 BeamaBuddy[683:175867] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 22.8s
╚═══════════════════════════════════════════════════════════
🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:04:59.487791+0530 BeamaBuddy[683:175867] 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:04:59.494681+0530 BeamaBuddy[683:175685] [activitychange] - on_foot 100
2019-09-11 12:04:59.498578+0530 BeamaBuddy[683:175685] [location] - [object Object]
2019-09-11 12:04:59.499615+0530 BeamaBuddy[683:175685] [location] - [object Object]

📍<+11.11281816,+77.03572744> +/- 413.55m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:05:00 PM India Standard Time
2019-09-11 12:05:00.045359+0530 BeamaBuddy[683:176220] 
📍<+11.11281816,+77.03572744> +/- 413.55m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:05:00 PM India Standard Time

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════
2019-09-11 12:05:00.045597+0530 BeamaBuddy[683:176342] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════
🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:05:00.046152+0530 BeamaBuddy[683:176342] 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:05:00.050815+0530 BeamaBuddy[683:175685] [location] - [object Object]

📍<+11.11283032,+77.03572647> +/- 165.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:05:00 PM India Standard Time
2019-09-11 12:05:00.089435+0530 BeamaBuddy[683:176342] 
📍<+11.11283032,+77.03572647> +/- 165.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:05:00 PM India Standard Time

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════
2019-09-11 12:05:00.090654+0530 BeamaBuddy[683:176220] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════
ℹ️-[TSLocationManager locationManager:didUpdateLocations:] <IGNORED> Δt since last: 0.0s
2019-09-11 12:05:00.092455+0530 BeamaBuddy[683:176353] ℹ️-[TSLocationManager locationManager:didUpdateLocations:] <IGNORED> Δt since last: 0.0s

📍<+11.11283167,+77.03573311> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:05:01 PM India Standard Time
2019-09-11 12:05:01.678633+0530 BeamaBuddy[683:176353] 
📍<+11.11283167,+77.03573311> +/- 65.00m (speed -1.00 mps / course -1.00) @ 11/09/19, 12:05:01 PM India Standard Time

╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════
2019-09-11 12:05:01.678998+0530 BeamaBuddy[683:176342] 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 10.0m | age: 0.0s
╚═══════════════════════════════════════════════════════════
🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:05:01.683727+0530 BeamaBuddy[683:176342] 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 65.0
2019-09-11 12:05:01.697052+0530 BeamaBuddy[683:175685] [location] - [object Object]
ℹ️-[TSDBLogger db_save] Log committed
2019-09-11 12:05:16.549893+0530 BeamaBuddy[683:176489] ℹ️-[TSDBLogger db_save] Log committed
🔵-[TSHttpService init]_block_invoke Network: Cellular | Flags: WR -t-----
2019-09-11 12:05:17.733164+0530 BeamaBuddy[683:176490] 🔵-[TSHttpService init]_block_invoke Network: Cellular | Flags: WR -t-----

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════
2019-09-11 12:05:17.764715+0530 BeamaBuddy[683:176489] 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:error:] 
╚═══════════════════════════════════════════════════════════

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════
2019-09-11 12:05:17.784261+0530 BeamaBuddy[683:176490] 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 1
╚═══════════════════════════════════════════════════════════
2019-09-11 12:05:17.784297+0530 BeamaBuddy[683:175685] [connectivitychange] - connected? true
🔵-[TSLocationManager onSuspend:] enabled? 1)
2019-09-11 12:05:18.772286+0530 BeamaBuddy[683:176488] 🔵-[TSLocationManager onSuspend:] enabled? 1)
ℹ️-[TSDBLogger db_save] Log committed
2019-09-11 12:05:18.783306+0530 BeamaBuddy[683:176490] ℹ️-[TSDBLogger db_save] Log committed
ℹ️-[TSDBLogger db_save] Log committed
2019-09-11 12:05:18.795668+0530 BeamaBuddy[683:176489] ℹ️-[TSDBLogger db_save] Log committed
🔵-[TSLocationManager onAppTerminate] stopOnTerminate? 0
2019-09-11 12:05:18.796328+0530 BeamaBuddy[683:176489] 🔵-[TSLocationManager onAppTerminate] stopOnTerminate? 0
🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 150
2019-09-11 12:05:18.796511+0530 BeamaBuddy[683:176599] 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 150
2019-09-11 12:05:18.798224+0530 BeamaBuddy[683:175685] [TSBackgroundFetch onAppTerminate]
2019-09-11 12:05:18.799195+0530 BeamaBuddy[683:176599] 🔴-[TSLocationManager stopUpdatingLocation] 

@christocracy
Copy link
Member

So?

@nijeshw
Copy link

nijeshw commented Sep 11, 2019

Do you have any idea, why location not updated after app terminate?

@christocracy
Copy link
Member

Have you read the docs for Config.stopOnTerminate?

@nijeshw
Copy link

nijeshw commented Sep 11, 2019

Yes, already I have set stopOnTerminate to false

@christocracy
Copy link
Member

christocracy commented Sep 11, 2019

And what do the docs tell you about the behavior of ios after the app is terminated?

@nijeshw
Copy link

nijeshw commented Sep 11, 2019

Before an iOS app terminates, the plugin will ensure that a stationary geofence of stationaryRadius meters is created around the last known position. When the user moves beyond the stationary geofence (typically ~200 meters), iOS will completely reboot your application in the background, and the plugin will resume tracking. iOS maintains geofence monitoring at the OS level, in spite of application terminate / device reboot.

For me tracking doesn't resume in background even I have travelled more than 2 KM

@christocracy
Copy link
Member

Verify it works in the iOS simulator, while simulating location with Freeway Drive.

@nijeshw
Copy link

nijeshw commented Sep 12, 2019

Yes I have tested in iOS simulator but it doesn't work, here is my code, do I need to add any config parms? Can you please confirm


async ionViewDidEnter() {
    await this.platform.ready();
    this.device = (<any>window).device;
    this.configureBackgroundGeolocation();
}
configureBackgroundGeolocation() {
    // 1. Listen to events (see the docs a list of all available events)
    BackgroundGeolocation.onLocation(this.onLocation.bind(this));
    BackgroundGeolocation.onMotionChange(this.onMotionChange.bind(this));
    BackgroundGeolocation.onActivityChange(this.onActivityChange.bind(this));
    BackgroundGeolocation.onGeofence(this.onGeofence.bind(this));
    BackgroundGeolocation.onHttp(this.onHttp.bind(this));
    BackgroundGeolocation.onEnabledChange(this.onEnabledChange.bind(this));
    BackgroundGeolocation.onConnectivityChange(this.onConnectivityChange.bind(this));
    // 2. Configure the plugin
    BackgroundGeolocation.ready({
      debug: true,
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 10,
      preventSuspend: true,
      heartbeatInterval: 60,
      stopOnTerminate: false,
      stopOnStationary: false,
      startOnBoot: true,
      url: 'http://tracker.transistorsoft.com/locations/nigesh',
      autoSync: true,
      params: BackgroundGeolocation.transistorTrackerParams(this.device),
    }, (state) => {
      if (!state.enabled) {
        BackgroundGeolocation.start();
      } else {
      }
    });
  }
  onLocation(location: Location) {
    console.log('[location] -', location);
  }
  onMotionChange(event: MotionChangeEvent) {
    console.log('[motionchange] -', event.isMoving, event.location);
  }
  onActivityChange(event: MotionActivityEvent) {
    console.log('[activitychange] -', event.activity, event.confidence);
  }
  onGeofence(event: GeofenceEvent) {
    console.log('[geofence] -', event.action, event.identifier, event.location);
  }
  onHttp(event: HttpEvent) {
    console.log('[http] -', event.success, event.status, event.responseText);
  }
  onEnabledChange(enabled: boolean) {
    console.log('[enabledchange] - enabled? ', enabled);
  }
  onConnectivityChange(event: ConnectivityChangeEvent) {
    console.log('[connectivitychange] - connected?', event.connected);
  }

@christocracy
Copy link
Member

If it doesn’t work in sim, the problem is in your code. Make sure your app executes #ready no matter what, each time the app launches, being aware that your app may be launched automatically in the background by the os.

@jvcjunior
Copy link

I'm facing the same problem as @nijesh17

@christocracy
Copy link
Member

christocracy commented Sep 12, 2019

I do not have this issue in the SampleApp. Try it in the simulator.

@jvcjunior
Copy link

jvcjunior commented Sep 12, 2019

I just tried what you've mentioned: "executes #ready no matter what, each time the app launches" and it worked. Now I need to find out why executing after login into my app and in certain conditions, it does not work.

What should I do in case I need to check if the logged user has some particular property and then start to collect his positions?

@christocracy
Copy link
Member

The plugin persists its enabled state. When you call #ready and the plugin is already state.enabled == true, the #ready method automatically calls #start upon itself.

@nijeshw
Copy link

nijeshw commented Sep 16, 2019

Do I need to add any other configuration other than this #987 (comment) to work on iOS?

@christocracy
Copy link
Member

Config options are not the issue.

I suggest you make a simple hello world app for yourself and first experiment in the simulator.

@stale
Copy link

stale bot commented Nov 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

@stale stale bot added the stale label Nov 15, 2019
@stale
Copy link

stale bot commented Nov 22, 2019

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

@stale stale bot closed this as completed Nov 22, 2019
@paragghadge
Copy link

@jeya-duraisamy Did you find the solution? I am also facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants