Skip to content

QA: Location Uploading: React Native Background Geolocation

Rebecka Z edited this page Apr 20, 2018 · 1 revision

Note: This is a reference doc per react-native-background-geolocation library. Last updated April 13, 2018

Key Points

  1. Tracking ends after user "kills" the app.
  2. Low battery mode (yellow battery) affects location uploads. It turns off background app refresh.
  3. Library has a default confidence level of 75% (?) for minimumActivityRecognitionConfidence, can change it to trigger a state-change.
  4. preventSuspend, default is false, it's meant to prevent iOS from suspending the app while in background in stationary state. It is used in conjunction with #heartbeatInterval
  5. Per the specs below, the device will be detected to be moving when it moves 25 meters (82 feet) in 10 seconds or more. However, location uploads will not be sent until the app moves 5 more meters (due to the distanceFilter being 30 meters). While the app is not killed/suspended.

From the horse's mouth:

  • When the device is detected to be moving, the plugin will automatically start recording a location according to the configured distanceFilter (meters).
  • When the device is detected be stationary, the plugin will automatically turn off location-services to conserve energy.

tinyrobot debugger (available on staging only)

image.png

tinyrobot specs

- -
default radius 50 meters, 100 meters in diameter

Distance

meters feet miles
25 m = 82 ft = 0.01 mi
30 m = 98 ft = 0.01 mi
50 m = 164 ft = 0.03 mi
100 m = 328 ft = 0.06 mi

Time

ms sec
1000 ms 1 sec
10,000 ms 10 secs

library specs

- -
desiredAccuracy highest power, highest accuracy (0) and lowest power, lowest accuracy (1000); location providers: GPS + Wifi + Cellular, Highest power; highest accuracy
distanceFilter minimum distance (in meters) a device must move horizontally before an update event is generated (default is 10m)
stationaryRadius When stopped, the min. distance the device must move beyond the stationary location for aggressive background-tracking to engage (default is 25m)
activityType Presumably, this affects ios GPS algorithm. See here "CLLocationManager" for more info. (default is ACTIVITY_TYPE_OTHER)
activityRecognitionInterval The desired time between activity detections. Larger values will result in fewer activity detections while improving battery life. A value of 0 will result in activity detections at the fastest possible rate. (default is 10,000ms ~ 10 seconds)
activitychange Fired when the activity-recognition system detects a change in detected-activity (still, on_foot, in_vehicle, on_bicycle, running)

App State:

- -
Not Running Not launched/terminated by system
Inactive Running in foreground (transitional)
Active Receiving events
Background Executing code
Suspended Not executed, remains in memory

Location Debug View

This view (only available on Staging) is aimed at helping QA understand when/how location updates are getting sent to the backend. We use react-native-background-geolocation to do the heavy lifting and most of the values on the Location Debug screen reflect configuration settings on that module.

Background location debug mode

Toggle debug mode on react-native-background-geolocation

Debug sounds

When activated, this will play a "tweet" sound whenever a location update has successfully been sent to our backend. If the request failed it will play a different, more "ominous" sound.

desiredAccuracy

distanceFilter

stationaryRadius

activityType

activityRecognitionInterval