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

Unknown activity type on iOS

Open paultranvan opened this issue 1 year ago • 6 comments

Your Environment

  • Plugin version: 4.12.1
  • Platform: iOS
  • OS version: 13-16
  • Device manufacturer / model: iPhone 13-16
  • React Native version (react-native -v):11.13.5
  • Plugin config
{
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
      showsBackgroundLocationIndicator: false, 
      distanceFilter: 10,
      stationaryRadius: 25,
      stopTimeout: 11,
      startOnBoot: true,
      stopOnTerminate: false, 
      enableHeadless: true,
 }

Expected Behavior

Locations activity should indicate the activity type, i.e. "walking", "in_vehicle", etc.

Actual Behavior

With some devices, with the tracking enabled for real-life trips, nearly all activity types are "unknown". It seems to happen notably when the trip starts with a car motion activity. Depending on the device, this can happen in few cases, or ~50% of cases, or >90% of cases. We never experienced the issue with Android.

Steps to Reproduce

Hard to reproduce, as it happens in real-life trips, on some devices (but always iOS).

Context

Tracking user trips based on location data, thanks to this plugin

Debug logs

Logs

paultranvan avatar Sep 11 '23 10:09 paultranvan

Motion activity info is only available if the user does not deny the “Health & Fitness” permission.

christocracy avatar Sep 11 '23 10:09 christocracy

@christocracy Yes, the permission was always accepted on the devices. And I suppose 100% of the activity types would be "unknown" otherwise

paultranvan avatar Sep 11 '23 12:09 paultranvan

Then it's a problem on the device (eg: accelerometer, gyroscope, magnetometer). The iOS Motion API is a black box that offers no configuration. It has only an ON/OFF switch. The data provided by that API is iOS' secret algorithm fusing accelerometer, gyroscope and magnetometer to output still, in_vehicle, etc.

christocracy avatar Sep 11 '23 12:09 christocracy

All right, I assume you didn't have any other feedback about this iOS issue? At this point we are suspecting that setting a too intensive tracking might hurt the sensors availability

paultranvan avatar Sep 11 '23 14:09 paultranvan

too intensive tracking might hurt the sensors availability

I highly doubt that. The location api does not affect sensors.

christocracy avatar Sep 11 '23 15:09 christocracy

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

github-actions[bot] avatar May 04 '24 01:05 github-actions[bot]

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

github-actions[bot] avatar May 18 '24 01:05 github-actions[bot]