
Think of this as your “FullTracking_LowRouteDetail” template for start().
These are starting values – you can tweak later by field-testing different templates.
| Setting | Suggested value | Why |
|---|---|---|
desiredAccuracy | DESIRED_ACCURACY_MEDIUM | Good for 200–300 m geofences; cheaper than HIGH. Recent versions also bump accuracy up internally as needed when moving. GitHub |
distanceFilter | 50–75 m | For a 300 m radius, this is plenty. A car will cross several 50–75 m steps on approach, so geofence entry is still fast, but you’re not tracking every tiny move. GitHub |
stationaryRadius | 25–50 m | When they stop near the site, plugin can quickly consider them “stationary” and power down, as long as they’re not roaming around. |
stopTimeout | 5–10 minutes | After ~5–10 min with no significant movement, go to stationary mode and save battery; fine for employees who stay on site for hours. GitHub+1 |
locationUpdateInterval (Android) | 60,000 ms (60s) | Upper bound on how often Android gives updates when moving. With distanceFilter 50–75 m, you’ll usually get distance-based triggers first, but this keeps a cap on time-based events. |
fastestLocationUpdateInterval (Android) | 30,000 ms (30s) | Prevents extremely rapid updates during GPS “bursts”. |
| Setting | Suggested value | Why |
|---|---|---|
activityRecognitionInterval (Android) | 60,000 ms | Don’t constantly query the motion API; once a minute is enough. |
stopOnTerminate | false | Continue tracking after reboot / app swipe, which you want for auto clock-in/out. transistorsoft.github.io |
startOnBoot | true | Same reason as above – device restart shouldn’t break auto clocking. |
preventSuspend (iOS) | false (for now) | Only turn this on if you find iOS is too aggressive. It keeps the JS awake more often but costs battery. Transistor Software |
geofenceProximityRadius | 1000–1500 m | Ensures the SDK starts monitoring geofences well before the user arrives, so enter triggers are prompt even in start() mode. transistorsoft.github.io |
geofenceInitialTriggerEntry | true | So when tracking starts and the employee is already inside a site, you get an immediate ENTER to clock them in. |
Heartbeat: don’t run heartbeatInterval every 1–2 minutes. If you must use heartbeat for daily device status, keep it to 15–30 minutes or even schedule it for specific times only.
preventSuspend: true unless you really need ultra-fast stationary-exit on iOS; it keeps the app much more active. Transistor Software
Very small distanceFilter (e.g. 5–10 m) + DESIRED_ACCURACY_HIGH: that’s when you get “Google Maps level” tracking and big battery cost.
start() without storing travel routesThere are two layers of data to think about:
On the device (inside the SDK)
The plugin always keeps some locations in its own SQLite DB until they’re synced or purged. That’s fine – it’s local to the phone. You can control retention with things like maxDaysToPersist. npmjs.com
On your backend (your ClickTime portal)
This is where you care about not storing routes.
Do not set:
url
autoSync
batchSync
etc.
Instead:
Listen for geofence events and send only clock data:
You can ignore the continuous onLocation events completely if all you care about is geofence enter / exit.
Result:
Phone may internally record locations for tracking & geofencing logic, but
your server never sees the route – only clock-in / clock-out events.
If you’re worried about internal DB growth, periodically:
use a low maxDaysToPersist (e.g. 1–3 days), or
call BackgroundGeolocation.destroyLocations() at a safe time (e.g. once your daily payroll export is done).
Geofence events (onGeofence with ENTER / EXIT) are not driven by locationUpdateInterval. They’re driven by:
The OS geofencing API + Transistorsoft’s geofencing logic.
Conceptually:
Geofences are “watched” at the OS level.
When the device crosses a geofence boundary:
The OS / SDK generates a geofence event immediately (subject to normal GPS timing/drift).
The plugin calls your onGeofence callback.
That entry/exit is independent of the scheduled “tracking updates” from locationUpdateInterval.
So:
Setting locationUpdateInterval = 3 minutes
May reduce how often you receive regular tracking locations (onLocation),
But does not intentionally wait 3 minutes to deliver a geofence ENTER or EXIT.
start()?startGeofences()?geofenceModeHighAccuracy = false
Use a radius around 200–300m (which you’re already doing), not tiny 30–50m fences, for car arrivals.maxDaysToPersist = 0 → meaning no automatic purge. Do Not Change This -1 → Unlimited persistence (no cap on record count). Do Not Change This