react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

iOS 17.5: High Accuracy and Speed Issues After Resuming BackgroundGeolocation

Open evan-proground opened this issue 1 year ago • 6 comments

Your Environment

  • Plugin version: 4.14.5
  • Platform: iOS
  • OS version: 17.5
  • Device manufacturer / model: iPhone (iOS 17.5+)
  • React Native version (react-native -v): 0.72.10
  • Plugin config
BackgroundGeolocation.ready({
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 10000000,
      stopTimeout: 15,
      isMoving: true,
      foregroundService: true,
      showsBackgroundLocationIndicator: true,
      stopOnTerminate: true,
      startOnBoot: false,
      disableStopDetection: true,
      pausesLocationUpdatesAutomatically: false,
      //  disableMotionActivityUpdates: true,
      // allowIdenticalLocations: true,
      notification: {
        title: 'SuperWalk',
        text: 'Detecting ...',
        smallIcon: 'ic_notification',
        color: '#FD3D00',
      },
      locationAuthorizationRequest: 'WhenInUse',
      backgroundPermissionRationale: {
        title: t('app_inner_c.background_permission_title'),
        message: t('app_inner_c.background_permission_message'),
        positiveAction: t('app_inner_c.background_permission_action'),
      },
      locationAuthorizationAlert: {
        titleWhenNotEnabled: t('app_inner_c.location_alert_title'),
        titleWhenOff: t('app_inner_c.location_alert_title'),
        instructions: t('app_inner_c.location_alert_message'),
        cancelButton: t('app_inner_c.location_alert_cancel'),
        settingsButton: t('app_inner_c.location_alert_settings'),
      },
      maxRecordsToPersist: 2,
      disableLocationAuthorizationAlert: true,
      debug: false,
      logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
});

Expected Behavior

When resuming from a paused state, the app should continue to receive accurate geolocation data.

Actual Behavior

When resuming from a paused state, the app receives geolocation data with accuracy values greater than 35 (indoors), and sometimes no GPS coordinated are received.

Steps to Reproduce

  1. Configure the app with the provided plugin config.
  2. Call BackgroundGeolocation.start.
  3. Call BackgroundGeolocation.getCurrentPosition every 2 seconds.
  4. Stop calling BackgroundGeolocation.getCurrentPosition for 5 seconds.
  5. Resume calling BackgroundGeolocation.getCurrentPosition every 2 seconds.
  6. Call BackgroundGeolocation.stop, then call BackgroundGeolocation.start again, and observe that the problem persists.
  7. Restart the app, call BackgroundGeolocation.start, and then call BackgroundGeolocation.getCurrentPosition to see the issue is resolved.

Context

I am using the BackgroundGeolocation.getCurrentPosition method to fetch geolocation data every 2 seconds. The values obtained from this method are used within the app. When the method is called after a 5-second pause, the logs show accuracy values around 40.4 and speed as -1. The logs and values are shown below. • This issue occurs on iOS version 17.5 and above. • The distanceFilter was set high to use BackgroundGeolocation.getCurrentPosition for obtaining the current location at specific times. • Changing the distanceFilter to 1 resolves the issue. However, the reason for this behavior on iOS 17.5 is unclear.

Debug logs

Logs

2024-05-22 15:21:37.362 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:21:37.362 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:21:37.369 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:21:37.369 
📍<+37.48029161,+126.95394468> +/- 14.28m (speed 0.10 mps / course 263.52) @ 2024. 5. 22. 오후 3시 21분 37초 대한민국 표준시

2024-05-22 15:21:37.369 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:21:37.369 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (368 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:37.370 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:37.370 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.3

2024-05-22 15:21:37.370 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:37.378 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:21:37.378 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: F0214337-04CE-4447-91D1-1E17BC6DEB77

2024-05-22 15:21:37.378 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:37.378 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:37.488 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | running/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:39.341 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:21:39.341 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:21:39.349 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:21:39.349 
📍<+37.48028810,+126.95394377> +/- 14.28m (speed 0.32 mps / course 263.52) @ 2024. 5. 22. 오후 3시 21분 39초 대한민국 표준시

2024-05-22 15:21:39.349 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:21:39.349 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (348 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:39.350 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:39.350 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.4

2024-05-22 15:21:39.350 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:39.357 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:21:39.357 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 3B536A73-AFEB-4639-940D-972157FE2368

2024-05-22 15:21:39.357 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:39.357 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

---------------------------- pause point ---------------------------

2024-05-22 15:21:39.946 ✅-[LocationDAO clear]_block_invoke Destroyed all locations

2024-05-22 15:21:40.025 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | running/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

---------------------------- resume point ---------------------------

2024-05-22 15:21:53.448 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:21:53.448 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:21:53.455 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:21:53.455 
📍<+37.48028548,+126.95397611> +/- 14.24m (speed 0.00 mps / course 263.52) @ 2024. 5. 22. 오후 3시 21분 45초 대한민국 표준시

2024-05-22 15:21:53.455 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:21:53.455 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (8454 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:53.456 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:53.456 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.3

2024-05-22 15:21:53.456 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:53.460 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:21:53.460 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 70989B8F-6F44-4C35-BA30-6D64C9840263

2024-05-22 15:21:53.460 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:53.460 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:55.421 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:21:55.421 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:21:55.429 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:21:55.429 
📍<+37.48034315,+126.95402690> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 21분 53초 대한민국 표준시

2024-05-22 15:21:55.429 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:21:55.429 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (1978 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:55.430 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:55.430 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.3

2024-05-22 15:21:55.430 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:55.437 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:21:55.437 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 98DC056C-8571-4171-984A-2A311EF2ABA1

2024-05-22 15:21:55.437 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:55.437 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:57.450 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:21:57.450 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:21:57.458 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:21:57.458 
📍<+37.48035043,+126.95403332> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 21분 55초 대한민국 표준시

2024-05-22 15:21:57.458 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:21:57.458 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (2034 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:57.458 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:57.458 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.3

2024-05-22 15:21:57.458 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:57.466 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:21:57.466 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: BC66D547-B9B1-4B92-A902-C7A0BFB9469C

2024-05-22 15:21:57.466 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:57.466 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:59.414 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:21:59.414 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:21:59.421 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:21:59.421 
📍<+37.48035124,+126.95403402> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 21분 57초 대한민국 표준시

2024-05-22 15:21:59.421 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:21:59.421 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (1968 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:59.422 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:59.422 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.3

2024-05-22 15:21:59.422 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:21:59.430 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:21:59.430 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: C208100C-CEC7-4ACB-AF29-8BDB388CEFD7

2024-05-22 15:21:59.430 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:21:59.430 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:00.365 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | running/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:01.451 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:01.452 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:01.460 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:01.460 
📍<+37.48035043,+126.95403331> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 21분 59초 대한민국 표준시

2024-05-22 15:22:01.460 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:01.460 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (2043 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:01.461 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:01.461 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.3

2024-05-22 15:22:01.461 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:01.468 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:01.468 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 4CF2F64A-1127-46F9-8B84-C14E571FFBD6

2024-05-22 15:22:01.468 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:01.468 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:03.443 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:03.443 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:03.451 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:03.451 
📍<+37.48034960,+126.95403258> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 22분 1초 대한민국 표준시

2024-05-22 15:22:03.451 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:03.451 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (1996 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:03.451 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:03.451 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.2

2024-05-22 15:22:03.451 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:03.459 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:03.459 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: D64CF531-C8EE-4E98-ABB8-2209931D6B96

2024-05-22 15:22:03.459 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:03.459 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:05.412 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:05.412 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:05.419 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:05.419 
📍<+37.48034902,+126.95403207> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 22분 3초 대한민국 표준시

2024-05-22 15:22:05.419 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:05.419 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (1973 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:05.419 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:05.419 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 40.4

2024-05-22 15:22:05.419 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:05.428 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:05.428 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: FCD939A9-D071-4E83-A892-FDA82085DFC0

2024-05-22 15:22:05.428 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:05.428 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:07.446 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:07.446 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:07.452 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:07.452 
📍<+37.48034868,+126.95403177> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 22분 5초 대한민국 표준시

2024-05-22 15:22:07.452 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:07.452 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (2036 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:07.452 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:07.452 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 40.4

2024-05-22 15:22:07.452 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:07.461 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:07.461 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 83C309F3-02E9-4814-A043-B47C5216F025

2024-05-22 15:22:07.461 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:07.461 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:09.448 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:09.449 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:09.455 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:09.455 
📍<+37.48034848,+126.95403160> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 22분 7초 대한민국 표준시

2024-05-22 15:22:09.455 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:09.455 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (2006 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:09.455 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:09.455 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 40.4

2024-05-22 15:22:09.455 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:09.465 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:09.465 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 320D16F6-C1DB-437C-A168-45747DB97D69

2024-05-22 15:22:09.465 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:09.465 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:11.445 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:11.445 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:11.452 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:11.452 
📍<+37.48034834,+126.95403147> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 22분 9초 대한민국 표준시

2024-05-22 15:22:11.452 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:11.452 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (2001 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:11.453 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:11.453 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 40.4

2024-05-22 15:22:11.453 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:11.462 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:11.462 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 395FDB38-D273-4854-9D31-3BF68ED83F53

2024-05-22 15:22:11.462 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:11.462 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:13.433 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 15:22:13.433 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 15:22:13.440 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-22 15:22:13.440 
📍<+37.48034824,+126.95403139> +/- 40.39m (speed -1.00 mps / course -1.00) @ 2024. 5. 22. 오후 3시 22분 11초 대한민국 표준시

2024-05-22 15:22:13.440 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 15:22:13.440 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (1991 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 15:22:13.440 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:13.440 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 40.4

2024-05-22 15:22:13.440 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 15:22:13.449 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 15:22:13.449 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 33D1F99A-C8EB-48E4-A790-68AE264D26F1

2024-05-22 15:22:13.449 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

evan-proground avatar May 22 '24 08:05 evan-proground

receives geolocation data with accuracy values greater than 35 (indoors), and sometimes no GPS

There is no GPS while indoors. GPS only works outdoors.

the plug-in has no control over the accuracy of returned data. Locations are fetched by the OS. .getCurrentPosition always uses highest possible accuracy.

christocracy avatar May 22 '24 13:05 christocracy

Hi, christocracy!

Could you please check log below?

At 14:24:37, getCurrentPosition was called. At 14:24:38, destroyLocation was called. After that, seems isMoving value was changed to 0 by createMotionTypeChangedHandler, but I don't know the cause. In what situations is createMotionTypeChangedHandler called?

024-05-22 14:24:35.264 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 14:24:37.249 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 14:24:37.250 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 14:24:37.254 ℹ️+[LocationAuthorization run:onCancel:] status: 4

2024-05-22 14:24:37.254 
📍<+37.48040022,+126.95397994> +/- 14.24m (speed 0.12 mps / course 316.98) @ 2024. 5. 22. 오후 2시 24분 37초 대한민국 표준시

2024-05-22 14:24:37.254 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 14:24:37.254 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (252 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-22 14:24:37.255 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 14:24:37.255 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.2

2024-05-22 14:24:37.255 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-22 14:24:37.262 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-22 14:24:37.262 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 7DD1806E-A7B4-472B-B896-DB315C63F24C

2024-05-22 14:24:37.262 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-22 14:24:37.262 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 14:24:38.837 ✅-[LocationDAO clear]_block_invoke Destroyed all locations

2024-05-22 14:24:43.320 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/33 | isMoving: 0
╚═══════════════════════════════════════════════════════════

2024-05-22 14:24:44.860 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-22 14:24:44.860 🎾-[LocationManager startUpdatingLocation] ON

2024-05-22 14:24:44.865 ℹ️+[LocationAuthorization run:onCancel:] status: 4

2024-05-22 14:24:44.866 
📍<+37.48041704,+126.95398389> +/- 14.22m (speed 0.00 mps / course 324.98) @ 2024. 5. 22. 오후 2시 24분 43초 대한민국 표준시

2024-05-22 14:24:44.866 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-22 14:24:44.866 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (1863 ms old)

judeProground avatar May 23 '24 06:05 judeProground

createMotionTypeChangedHandler

Don’t worry about the name of this. When you see this, it’s the native motion api firing a motion-activity event.

With your app one the foreground, you can cause the motion api to fire events by shaking your device vigorously. Letting it sit stationary will cause the motion api to emit the still event.

christocracy avatar May 23 '24 21:05 christocracy

Thank you, christocracy!

I am experiencing another issue and need your help.

When getCurrentPosition is called and abnormal GPS data is received, the API continues to return abnormal GPS data until it is restarted. Here are the logs when the issue occurs (outdoors with GPS signal):

2024-05-24 12:19:01.309 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-24 12:19:01.309 🎾-[LocationManager startUpdatingLocation] ON

2024-05-24 12:19:01.316 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-24 12:19:01.316 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-24 12:19:01.316 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0

2024-05-24 12:19:01.320 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-24 12:19:01.320 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 397B2AEC-CC0C-413F-A36F-630B6AF753BF

2024-05-24 12:19:03.315 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-24 12:19:03.315 🎾-[LocationManager startUpdatingLocation] ON

2024-05-24 12:19:03.322 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-24 12:19:03.322 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-24 12:19:03.323 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0

2024-05-24 12:19:03.330 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-24 12:19:03.330 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 1FEC16D2-4B55-4957-A6B8-77ED7998535A

When the app is restarted and the issue is resolved, the logs look like this:

2024-05-24 12:20:27.251 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-24 12:20:27.251 🎾-[LocationManager startUpdatingLocation] ON

2024-05-24 12:20:27.267 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-24 12:20:27.267 
📍<+37.47984933,+126.95488101> +/- 14.19m (speed 1.04 mps / course 122.68) @ 2024. 5. 24. 오후 12시 20분 27초 대한민국 표준시

2024-05-24 12:20:27.267 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-24 12:20:27.268 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (267 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-24 12:20:27.268 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-24 12:20:27.268 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.2

2024-05-24 12:20:27.268 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-24 12:20:27.279 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-24 12:20:27.279 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 9812A2FF-D73B-4EF2-9973-24A8F848E138

2024-05-24 12:20:27.279 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-24 12:20:27.279 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

2024-05-24 12:20:29.351 🔵-[TSLocationManager getCurrentPosition:] 

2024-05-24 12:20:29.352 🎾-[LocationManager startUpdatingLocation] ON

2024-05-24 12:20:29.370 ℹ️+[LocationAuthorization run:onCancel:] status: 3

2024-05-24 12:20:29.370 
📍<+37.47984013,+126.95488433> +/- 14.19m (speed 0.32 mps / course 139.54) @ 2024. 5. 24. 오후 12시 20분 29초 대한민국 표준시

2024-05-24 12:20:29.370 🔴-[LocationManager stopUpdatingLocation] OFF

2024-05-24 12:20:29.370 
╔═══════════════════════════════════════════════════════════
║ -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (369 ms old)
╚═══════════════════════════════════════════════════════════

2024-05-24 12:20:29.371 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-24 12:20:29.371 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 14.2

2024-05-24 12:20:29.371 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-05-24 12:20:29.382 ℹ️-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 2

2024-05-24 12:20:29.382 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 726ABC5A-6D6D-4134-B9A9-22376708752C

2024-05-24 12:20:29.382 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService flush:] 
╚═══════════════════════════════════════════════════════════

2024-05-24 12:20:29.382 
╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] Success: 0
╚═══════════════════════════════════════════════════════════

Could you help me understand what might be causing this issue?

evan-proground avatar May 24 '24 05:05 evan-proground

Create for a simple hello-world app which reproduces your problem. Share it with me in a public repo.

christocracy avatar May 24 '24 11:05 christocracy

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

github-actions[bot] avatar Jun 24 '24 01:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jul 08 '24 01:07 github-actions[bot]