Field Track 360

Geofences and dwell

01 Sept 2026 · Field Track 360

addGeofence needs ready() and location authorization, but not a session. A fence fires whether or not you are recording, and keeps firing after stop().

A fence armed around where you already are fires enter immediately. CoreLocation reports transitions only, so without this a fence created at your current position would report nothing until you left and came back.

Crossings arrive two ways, and you need both

While your app runs, events() carries them live. But iOS relaunches a terminated app to deliver a crossing, and at that moment nothing is subscribed - the event stream has no replay. Every crossing is therefore also written to disk:

``` let crossings = try await TrackIt.shared.getGeofenceEvents(limit: 50) ```

What the platform imposes

  • 20 regions per app, shared with anything you monitor yourself. The SDK reserves one, so 19 are available.
  • ~100 m minimum radius. Smaller regions fire unreliably; a smaller fence is accepted and emits a diagnostic.
  • Always authorization is needed to wake a terminated app.
  • Re-using an id replaces that fence, with no window where neither exists.

Dwell

iOS has no dwell transition, so the SDK synthesises it. What that costs you is timing, not truth: the recorded event's timeMs is the moment the condition was met, not the moment the SDK noticed. A dwell reported at 15:10 for a condition met at 14:32 says 14:32.