Skip to content

[Bug]: iOS extra location with geofence event #2616

Description

@sametcl2

Required Reading

  • Confirmed

Plugin Version

5.1.1

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

iPhone 17 Pro

Device operating-systems(s)

iOS 26.4

React Native / Expo version

0.84.1

What happened?

I observed that on iOS, location is being recorded with a "geofence" event when enter/exit to a geofence. I didn't see this on Android, and I couldn't see anything with a location that has a "geofence" event on onLocation.

How can I prevent recording this event?

Plugin Code and/or Config

export const LOCATION_CONFIG: Config = {
  geolocation: {
    desiredAccuracy: BackgroundGeolocation.DesiredAccuracy.High,
    distanceFilter: 25,
    stopTimeout: 5,
    stationaryRadius: 25,
    stopOnStationary: false,
    pausesLocationUpdatesAutomatically: false,
    showsBackgroundLocationIndicator: true,
    geofenceModeHighAccuracy: true,
    geofenceInitialTriggerEntry: true,
    locationAuthorizationRequest: 'Always',
    filter: {
      policy: BackgroundGeolocation.LocationFilterPolicy.Adjust,
      useKalman: true,
      filterDebug: true,
      kalmanDebug: true,
      kalmanProfile: BackgroundGeolocation.KalmanProfile.Default,
      trackingAccuracyThreshold: 50,
      maxImpliedSpeed: 30
    }
  },
  app: {
    stopOnTerminate: false,
    startOnBoot: true,
    heartbeatInterval: 60,
    preventSuspend: true,
    notification: {
      sticky: true
    },
    backgroundPermissionRationale: {
      title: t('AllowBackgroundLocationMessageTitle'),
      message: t('AllowBackgroundLocationMessage'),
      positiveAction: t('AllowBackgroundLocation'),
      negativeAction: t('Cancel')
    }
  },
  logger: {
    debug: true,
    logLevel: BackgroundGeolocation.LogLevel.Verbose,
    logMaxDays: 1
  },
  persistence: {
    maxRecordsToPersist: 1000,
    maxDaysToPersist: 1,
    persistMode: BackgroundGeolocation.PersistMode.Location
  }
}

Relevant log output

-[TSHttpResponse handleResponse] Response: 200
🔵 -[TSHttpService doPost:callback:]_block_invoke flush=6B12AB0B-F82B-4F9B-82D6-F5722AFC726C post status=200 retry=0 busy=1
✅ -[TSHttpService post:]_block_invoke DESTROY: F3E4D7A8-8C53-4B41-8A10-1A3932117C71
🔵 -[TSHttpService post:]_block_invoke sync_page ok=1 size=1
✅ -[TSHttpService schedulePost] LOCKED: 39B8495E-5ECE-48DF-8FD7-5E220CA4D328
🔵 -[TSHttpResponse handleResponse] Response: 200
🔵 -[TSHttpService doPost:callback:]_block_invoke flush=6B12AB0B-F82B-4F9B-82D6-F5722AFC726C post status=200 retry=0 busy=1
✅ -[TSHttpService post:]_block_invoke DESTROY: 39B8495E-5ECE-48DF-8FD7-5E220CA4D328
🔵 -[TSHttpService post:]_block_invoke sync_page ok=1 size=1

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] success=1 queued_before=1 synced=2 pages=2 duration_ms=1067
╚═══════════════════════════════════════════════════════════
✅ -[TSBackgroundTaskManager stopBackgroundTask:]_block_invoke 15 OF {(
    15,
    14
)}
🔴 -[TSTimerService stop] ⏰ [timeAcquisitionBufferTimer]
alignItems was given a value of center, this has no effect on headerStyle.
RCTScrollViewComponentView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.
🔵 -[TSGeofenceDAO doInsert:geofence:] restaurant-fb1973d7-f518-4132-bbb9-3e00e3532bd3

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 1 / 0 within 2000 m
╚═══════════════════════════════════════════════════════════
🟢 -[TSGeofenceManager startMonitoringGeofence:]
🟢 -[TSTimerService startWithInterval:repeating:callback:] ⏰ [geofenceEvaluationBuffer] Starting timer: 0.20s repeating: 0
🔵 -[TSGeofenceDAO doInsert:geofence:] order-f911c4ba-9beb-4099-94d2-240d47ab6a9c

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 2 / 0 within 2000 m
╚═══════════════════════════════════════════════════════════
🟢 -[TSGeofenceManager startMonitoringGeofence:]
🔴 -[TSTimerService stop] ⏰ [geofenceEvaluationBuffer]
🟢 -[TSTimerService startWithInterval:repeating:callback:] ⏰ [geofenceEvaluationBuffer] Starting timer: 0.20s repeating: 0
🔵 -[TSGeofenceDAO doInsert:geofence:] call-f911c4ba-9beb-4099-94d2-240d47ab6a9c

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 3 / 0 within 2200 m
╚═══════════════════════════════════════════════════════════
🟢 -[TSGeofenceManager startMonitoringGeofence:]
🔴 -[TSTimerService stop] ⏰ [geofenceEvaluationBuffer]
🟢 -[TSTimerService startWithInterval:repeating:callback:] ⏰ [geofenceEvaluationBuffer] Starting timer: 0.20s repeating: 0
🔵 -[TSGeofenceDAO doInsert:geofence:] restaurant-d82c491d-d6bc-4dfb-807f-4501de317ccf

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 4 / 0 within 2200 m
╚═══════════════════════════════════════════════════════════
🟢 -[TSGeofenceManager startMonitoringGeofence:]
🔴 -[TSTimerService stop] ⏰ [geofenceEvaluationBuffer]
🟢 -[TSTimerService startWithInterval:repeating:callback:] ⏰ [geofenceEvaluationBuffer] Starting timer: 0.20s repeating: 0
🔵 -[TSGeofenceDAO doInsert:geofence:] order-3f5d0cb2-cc1c-4358-8c84-b375af096802

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 5 / 0 within 2200 m
╚═══════════════════════════════════════════════════════════
🟢 -[TSGeofenceManager startMonitoringGeofence:]
🔴 -[TSTimerService stop] ⏰ [geofenceEvaluationBuffer]
🟢 -[TSTimerService startWithInterval:repeating:callback:] ⏰ [geofenceEvaluationBuffer] Starting timer: 0.20s repeating: 0
🔵 -[TSGeofenceDAO doInsert:geofence:] call-3f5d0cb2-cc1c-4358-8c84-b375af096802

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 6 / 0 within 2200 m
╚═══════════════════════════════════════════════════════════
🟢 -[TSGeofenceManager startMonitoringGeofence:]
🔴 -[TSTimerService stop] ⏰ [geofenceEvaluationBuffer]
🟢 -[TSTimerService startWithInterval:repeating:callback:] ⏰ [geofenceEvaluationBuffer] Starting timer: 0.20s repeating: 0
{
    allowStale = 1;
    desiredAccuracy = 10;
    extras = "<null>";
    finished = 0;
    geofenceEvent =     {
        action = ENTER;
        extras =         {
            geofenceId = "call-3f5d0cb2-cc1c-4358-8c84-b375af096802";
            geofenceType = CALL;
        };
        identifier = "call-3f5d0cb2-cc1c-4358-8c84-b375af096802";
        timestamp = "2026-06-22T13:53:25.450Z";
    };
    label = "TSGeofenceTransition:ENTER:call-3f5d0cb2-cc1c-4358-8c84-b375af096802";
    maximumAge = 10000;
    persist = 1;
    samples = 3;
    timeout = 30;
    type = 5;
}
🟢 -[TSLocationRequestService requestLocation:] [TSGeofenceTransition:ENTER:call-3f5d0cb2-cc1c-4358-8c84-b375af096802] maximumAge: 10000
{
    allowStale = 1;
    desiredAccuracy = 1;
    extras = "<null>";
    finished = 0;
    geofenceEvent =     {
        action = DWELL;
        extras =         {
            geofenceId = "call-3f5d0cb2-cc1c-4358-8c84-b375af096802";
            geofenceType = CALL;
        };
        identifier = "call-3f5d0cb2-cc1c-4358-8c84-b375af096802";
        timestamp = "2026-06-22T13:53:25.450Z";
    };
    label = "TSGeofenceTransition:DWELL:call-3f5d0cb2-cc1c-4358-8c84-b375af096802";
    maximumAge = 10000;
    persist = 1;
    samples = 9223372036854775807;
    timeout = 900;
    type = 5;
}
🟢 -[TSLocationRequestService requestLocation:] [TSGeofenceTransition:DWELL:call-3f5d0cb2-cc1c-4358-8c84-b375af096802] maximumAge: 10000
🔵 -[TSGeofenceDAO updateStateForIdentifier:entryState:hits:]_block_invoke Updated state for call-3f5d0cb2-cc1c-4358-8c84-b375af096802 (entry_state=1, state_updated_at=1782136405.450184, hits=1)

1:📍<+41.10931200,+29.04666500> +/- 5.00m (speed -1.00 mps / course -1.00) @ 22.06.2026, 16:53:25 GMT+03:00 | age: 428 ms

╔═══════════════════════════════════════════════════════════
║ -[TSSingleLocationRequest trySatisfyWithLocation:now:] 📍🔎 [TSGeofenceTransition:ENTER:call-3f5d0cb2-cc1c-4358-8c84-b375af096802] desiredAccuracy: 10.0 m, maximumAge: 10000 ms
╚═══════════════════════════════════════════════════════════
✅ -[TSSingleLocationRequest trySatisfyWithLocation:now:] 📍🔎 meets accuracy & staleness: return early: <+41.10931200,+29.04666500> +/- 5.00m (speed -1.00 mps / course -1.00) @ 22.06.2026, 16:53:25 GMT+03:00

╔═══════════════════════════════════════════════════════════
║ -[TSSingleLocationRequest trySatisfyWithLocation:now:] 📍🔎 [TSGeofenceTransition:DWELL:call-3f5d0cb2-cc1c-4358-8c84-b375af096802] desiredAccuracy: 1.0 m, maximumAge: 10000 ms
╚═══════════════════════════════════════════════════════════

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceTransition setTriggerLocation:] 📢 ENTER Geofence: call-3f5d0cb2-cc1c-4358-8c84-b375af096802
╚═══════════════════════════════════════════════════════════
🔵 -[TSLocationDAO shrink:db:] Shrank locations to max=1000 (deleted 0 rows)
✅ -[TSDataStore persist:] 💾 INSERT: C7288567-FF1C-456E-93C6-2CD261811139 (type: 5, persistMode: 1, maxRecords: 1000)

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService beginFlushWithCallback:overrideSyncThreshold:error:] 
╚═══════════════════════════════════════════════════════════
🔵 -[TSHttpService armFlushWatchdog] flush=B2DD4C52-E2EF-4753-A01E-4DA95E16B8B5 watchdog_armed timeout=60.000 watchdog=65.000
🔵 -[TSTrackingService getCurrentPosition:]
🟢 -[TSLocationRequestService requestLocation:] [getCurrentPosition] maximumAge: 0

╔═══════════════════════════════════════════════════════════
║ -[TSSingleLocationRequest trySatisfyWithLocation:now:] 📍🔎 [getCurrentPosition] desiredAccuracy: -1.0 m, maximumAge: 0 ms
╚═══════════════════════════════════════════════════════════
🔵 +[TSLocationHelper pickBestLocationBetween:and:desiredAccuracy:] desiredAccuracy: -1.000000
- A: 📍<+41.10931200,+29.04666500> +/- 5.00m (speed -1.00 mps / course -1.00) @ 22.06.2026, 16:53:25 GMT+03:00
- B: 📍<+41.10931200,+29.04666500> +/- 5.00m (speed -1.00 mps / course -1.00) @ 22.06.2026, 16:53:25 GMT+03:00
🔵 -[TSLocationRequestService requestLocation:]_block_invoke [CACHED] getCurrentPosition satisfied from lastLocation
✅ -[TSBackgroundTaskManager createBackgroundTask] Created background task: 20
✅ -[TSHttpService schedulePost] LOCKED: C7288567-FF1C-456E-93C6-2CD261811139
🔵 -[TSLocationDAO shrink:db:] Shrank locations to max=1000 (deleted 0 rows)
✅ -[TSDataStore persist:] 💾 INSERT: BE95B241-BFA7-4EA4-9C75-F23F4FFFA75F (type: 2, persistMode: 1, maxRecords: 1000)

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService beginFlushWithCallback:overrideSyncThreshold:error:] 
╚═══════════════════════════════════════════════════════════
[TS] notif status=2
🔵 -[TSGeofenceManager onEvaluate] - enabled? 1, _lastLocation? <+41.10931200,+29.04666500> +/- 5.00m (speed -1.00 mps / course -1.00) @ 22.06.2026, 16:53:25 GMT+03:00

╔═══════════════════════════════════════════════════════════
║ -[TSGeofenceManager evaluateProximity:] Found 6 / 6 within 2200 m
╚═══════════════════════════════════════════════════════════
🔴 -[TSTimerService stop] ⏰ [geofenceEvaluationBuffer]
🔵 -[TSHttpResponse handleResponse] Response: 200
🔵 -[TSHttpService doPost:callback:]_block_invoke flush=B2DD4C52-E2EF-4753-A01E-4DA95E16B8B5 post status=200 retry=0 busy=1
✅ -[TSHttpService post:]_block_invoke DESTROY: C7288567-FF1C-456E-93C6-2CD261811139
🔵 -[TSHttpService post:]_block_invoke sync_page ok=1 size=1
✅ -[TSHttpService schedulePost] LOCKED: BE95B241-BFA7-4EA4-9C75-F23F4FFFA75F
🔵 -[TSHttpResponse handleResponse] Response: 200
🔵 -[TSHttpService doPost:callback:]_block_invoke flush=B2DD4C52-E2EF-4753-A01E-4DA95E16B8B5 post status=200 retry=0 busy=1
✅ -[TSHttpService post:]_block_invoke DESTROY: BE95B241-BFA7-4EA4-9C75-F23F4FFFA75F
🔵 -[TSHttpService post:]_block_invoke sync_page ok=1 size=1

╔═══════════════════════════════════════════════════════════
║ -[TSHttpService finish:error:] success=1 queued_before=1 synced=2 pages=2 duration_ms=985
╚═══════════════════════════════════════════════════════════
✅ -[TSBackgroundTaskManager stopBackgroundTask:]_block_invoke 20 OF {(
    20,
    14
)}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions