Skip to content

[Help Wanted]: iOS Tracking Stops After App is Minimized #2271

Open
@louwjlabuschagne

Description

Required Reading

  • Confirmed

Plugin Version

4.18.2

Mobile operating-system(s)

  • iOS
  • Android

What do you require assistance about?

Description:

On iOS, tracking stops approximately 15 minutes after the user starts tracking and minimizes the app. Additionally, tracking does not automatically restart when movement resumes.

This issue is specific to iOS, as Android handles tracking correctly by relying on periodic tracking instead of movement-based tracking.

Steps to Reproduce:
1. Start tracking on an iOS device.
2. Minimize the app.
3. Wait approximately 15 minutes.
4. Observe that tracking has stopped and does not resume upon movement.

Expected Behavior:

Tracking should continue in the background or restart automatically when movement is detected, similar to the periodic tracking behavior on Android.

Environment:
• Platform: iOS
• Tracking Method: Movement-based tracking

Question:

Is there a way to fix or work around this issue on iOS to ensure continuous or periodic tracking when the app is minimized?

[Optional] Plugin Code and/or Config

await BackgroundGeolocation.ready({
  httpRootProperty: '.',
  locationTemplate:
    '{"age":"<%= age %>","accuracy":"<%= accuracy %>","longitude":"<%= longitude %>","latitude":"<%= latitude %>","timestamp":"<%= timestamp %>","batteryLevel":"<%= battery.level %>","odometer":"<%= odometer %>"}',
  // Debug
  reset: true,
  debug: false,
  logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
  // transistorAuthorizationToken: token,
  // Geolocation
  desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_NAVIGATION,
  distanceFilter: Platform.OS === 'android' ? 0 : 5,
  locationUpdateInterval: 1000,
  fastestLocationUpdateInterval: 10000,
  // stopTimeout: 5,
  // Permissions
  locationAuthorizationRequest: 'Always',
  // HTTP & Persistence
  autoSync: true,
  autoSyncThreshold: 50,
  batchSync: true,
  maxDaysToPersist: 14,
  maxBatchSize: 500,
  // Application
  // stopOnTerminate: false,
  // startOnBoot: true,
  enableHeadless: true,
  disableLocationAuthorizationAlert: true,
  disableElasticity: true,
  // disableStopDetection: true,
  pausesLocationUpdatesAutomatically: false,
  disableMotionActivityUpdates: true,
  heartbeatInterval: 60,
  stopOnTerminate: Platform.select({ default: true, android: false }),
  showsBackgroundLocationIndicator: true,
  stopOnStationary: false,
  backgroundPermissionRationale: {
    title: "Allow access to this device's location in the background",
    message: `In order to track your ${t('backgroundPermission_message')} activity in the background, please enable "Allow all the time" location permission`,
  },
});

[Optional] Relevant log output

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions