Skip to content

[Help Wanted]: iOS — DesiredAccuracy.Medium still maps to High Location Energy / GPS-class (NearestTenMeters)? Docs say Medium is Wifi+Cellular only #2643

Description

@lavpreetsandhu

Required Reading

  • Confirmed

Plugin Version

5.3.0

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

iPhone 13, 11

Device operating-systems(s)

iOS 26.5

React Native / Expo version

React Native 0.84.0

What do you require assistance about?

Expected Behavior
Per docs (DesiredAccuracy.Medium = Wifi + Cellular; “Only DESIRED_ACCURACY_HIGH uses GPS”), after:

BackgroundGeolocation.setConfig({
  geolocation: { desiredAccuracy: BackgroundGeolocation.DesiredAccuracy.Medium } // 10
});

Core Location should leave the GPS / Best energy path (similar to Low → HundredMeters).

Actual Behavior

Xcode Power Profiler → Location Energy:

  1. Plugin starts with kCLLocationAccuracyBest briefly (TSLocationRequestService startUpdatingLocked) → Location Energy High
  2. After onChangeDesiredAccuracy → kCLLocationAccuracyNearestTenMeters (Medium) → Location Energy stays High
  3. With Low (100) → kCLLocationAccuracyHundredMeters → Location Energy drops to Low

Same on mock GPS and a real drive. Fixes under Medium often still have meter-level coords.accuracy + speed/heading.

Steps to Reproduce

  1. ready() with config below (iOS), start()
  2. setConfig({ geolocation: { desiredAccuracy: DesiredAccuracy.Medium, distanceFilter: 50, elasticityMultiplier: 1 } })
  3. Confirm getState().geolocation.desiredAccuracy === 10
  4. Record Power Profiler; watch CL accuracy events + Location Energy

Context / question

Is Medium expected to use kCLLocationAccuracyNearestTenMeters and stay GPS-class / High energy on iOS?

If we need no GPS when idle (viewers=0), should we use Low / VeryLow instead of Medium?

Could any of these keep GPS-class location on even after Medium?

  • activityType: AutomotiveNavigation
  • disableElasticity: false + distanceFilter/elasticity
  • Kalman filter (LocationFilterPolicy.Adjust, Aggressive)
  • Motion / changePace / stop-detection creating a second CLLocationManager at Best

Evidence
Instruments CL: Best → NearestTenMeters; Location Energy remains High
Contrast: Low → HundredMeters; Location Energy Low

[Optional] Plugin Code and/or Config

await BackgroundGeolocation.ready({
  reset: true,
  geolocation: {
    desiredAccuracy: BackgroundGeolocation.DesiredAccuracy.High, // bootstrap
    distanceFilter: 30,          // iOS baseline; later setConfig → 50 when idle
    elasticityMultiplier: 1,
    disableElasticity: false,
    stopTimeout: 3,
    activityType: BackgroundGeolocation.ActivityType.AutomotiveNavigation,
    locationAuthorizationRequest: 'Any',
    showsBackgroundLocationIndicator: true,
    locationUpdateInterval: 2500,          // mainly Android
    fastestLocationUpdateInterval: 2000,
    deferTime: 0,
    geofenceProximityRadius: 150,
    geofenceInitialTriggerEntry: false,
    filter: {
      policy: BackgroundGeolocation.LocationFilterPolicy.Adjust,
      useKalman: true,
      kalmanProfile: BackgroundGeolocation.KalmanProfile.Aggressive,
      burstWindow: 3,
      trackingAccuracyThreshold: 50,
    },
  },
  activity: {
    minimumActivityRecognitionConfidence: 75,
    activityRecognitionInterval: 10000,
  },
  app: {
    stopOnTerminate: false,
    startOnBoot: true,
    enableHeadless: true,
  },
  persistence: {
    persistMode: BackgroundGeolocation.PersistMode.None,
  },
  logger: { debug: false, logLevel: BackgroundGeolocation.LogLevel.Off },
});

// Idle / no viewers:
await BackgroundGeolocation.setConfig({
  geolocation: {
    distanceFilter: 50,
    elasticityMultiplier: 1,
    desiredAccuracy: BackgroundGeolocation.DesiredAccuracy.Medium, // 10
    disableElasticity: false,
  },
});

[Optional] Relevant log output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions