react-native-background-geolocation: Missing Geo Points At Random Times

Your Environment

  • Plugin version: 4.17.1
  • Platform: iOS
  • OS version: 17.5.1
  • Device manufacturer / model: iPhone 13 Pro
  • React Native version: 0.71.19
  • Plugin config
BackgroundGeolocation.ready({
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      distanceFilter: 1,
      stopOnTerminate: false, 
      enableHeadless: true,
      showsBackgroundLocationIndicator: false,
      disableElasticity: true,
      desiredOdometerAccuracy: 10,
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      stationaryRadius: 5,
      stopDetectionDelay: 10,
      stopTimeout: 15,
      startOnBoot: true,
      maxRecordsToPersist: 0,
      backgroundPermissionRationale: {
        title: "Allow Solo to access to this device's location in the background?",
        message: t(TRACKING_MESSAGE),
        positiveAction: 'Change to {backgroundPermissionOptionLabel}',
        negativeAction: 'Cancel',
      },
    })

Expected Behavior

an uninterrupted stream of geo points that maps the entire route step by step

Actual Behavior

After upgrading from 4.14.4 to 4.17.1, we see some gaps in geo points at random times in every trip we’ve tested

Steps to Reproduce

Taking any trip that includes regular traffic delays, traffic light stops, parking lot exits/parking

Context

We are trying to understand what is causing the gap in geo points at times

Debug logs

Screenshot 2024-09-12 at 3 19 10 PM

background-geolocation (3).log

Logs
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 1.0m | age: 51 ms
╚═══════════════════════════════════════════════════════════

2024-09-11 18:32:16.053 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 4.8

2024-09-11 18:32:16.053 ℹ️-[TSConfig persist] 

2024-09-11 18:32:16.054 🔵-[TSConfig incrementOdometer:] 2551684.6

2024-09-11 18:32:16.054 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-09-11 18:32:17.048 
📍<+47.60018076,-122.29715073> +/- 4.77m (speed 12.94 mps / course 13.18) @ 2024-09-11, 18:32:17 Pacific Daylight Saving Time

2024-09-11 18:32:17.048 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 1.0m | age: 46 ms
╚═══════════════════════════════════════════════════════════

2024-09-11 18:32:17.048 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 4.8

2024-09-11 18:32:17.048 ℹ️-[TSConfig persist] 

2024-09-11 18:32:17.049 🔵-[TSConfig incrementOdometer:] 2551697.9

2024-09-11 18:32:17.050 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-09-11 18:34:48.147 ℹ️-[TSDBLogger db_save] Log committed

2024-09-11 18:34:48.152 
📍<+47.61387999,-122.28926545> +/- 3.90m (speed 11.52 mps / course 2.81) @ 2024-09-11, 18:34:48 Pacific Daylight Saving Time

2024-09-11 18:34:48.152 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 1.0m | age: 122 ms
╚═══════════════════════════════════════════════════════════

2024-09-11 18:34:48.152 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 4.8

2024-09-11 18:34:48.152 ℹ️-[TSConfig persist] 

2024-09-11 18:34:48.158 🔵-[TSConfig incrementOdometer:] 2553332.3

2024-09-11 18:34:48.159 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

2024-09-11 18:34:48.162 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | in_vehicle/100 | isMoving: 1
╚═══════════════════════════════════════════════════════════

2024-09-11 18:34:49.152 
📍<+47.61398782,-122.28926193> +/- 3.54m (speed 11.52 mps / course 1.41) @ 2024-09-11, 18:34:49 Pacific Daylight Saving Time

2024-09-11 18:34:49.152 
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 1.0m | age: 152 ms
╚═══════════════════════════════════════════════════════════

2024-09-11 18:34:49.152 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 4.8

2024-09-11 18:34:49.153 ℹ️-[TSConfig persist] 

2024-09-11 18:34:49.156 🔵-[TSConfig incrementOdometer:] 2553344.3

2024-09-11 18:34:49.159 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (16 by maintainers)

Most upvoted comments

was interested in if you released it to App Store

Apple doesn’t allow “demo apps” released publicly. You would have to release it yourself for testing and add up to 100 beta users.

My last 7 days of tracking:

Screenshot 2024-09-12 at 8 20 56 PM

You’re saying you experienced a loss of location-data at ~18:32:17?

I don’t see that at all. I see a continuous stream of reported locations.

I see you’re not using the plugin’s built-in, pure native HTTP service and you’ve disabled the plugin from inserting recorded locations into its SQLite database. I don’t trust HTTP requests through the react-native layer.

When you see this in the logs, the .onLocation event is 100% guaranteed to have fired.

2024-09-11 18:47:07.091 
📍<+47.68742524,-122.36700764> +/- 4.77m (speed 0.26 mps / course 155.07) @ 9/11/24, 6:47:06 PM Pacific Daylight Time