In this tutorial, we show you the Radar components to build a workforce management experience from end to end. You’ll learn how to power the full shift cycle: shift creation, shift experience, and reimbursement workflows. The core shift experience we’ll cover looks like this:Documentation Index
Fetch the complete documentation index at: https://docs.radar.com/llms.txt
Use this file to discover all available pages before exploring further.
- A shift is created
- A professional gets assigned a shift
- The professional starts traveling to the shift
- The professional’s live ETA and location updates are recorded
- The professional automatically clocks in upon arrival
- The professional automatically clocks out upon departure
- The professional is reimbursed either by time onsite and/or trip mileage
Features used
Shift lifecycle
| Step | Trigger | Radar feature |
|---|---|---|
| Shift created | A shift is created | Geofences API: create a geofence at the shift location |
| Professional assigned | The professional is assigned or picks up a shift | Set user metadata with shift context |
| Professional en route | The professional taps “Start route” | Trips: start a trip with the shift geofence as the destination |
| Live ETA tracking | The professional is traveling | user.updated_trip webhook |
| Approaching alert | The professional is nearby | user.approaching_trip_destination webhook |
| Auto clock-in | The professional enters the shift geofence | user.entered_geofence webhook |
| Auto clock-out | The professional exits the shift geofence | user.exited_geofence webhook |
| Mileage reimbursement | The shift is completed | Route matching API: calculates the trip’s mileage |
Getting started
If you haven’t already, sign up for Radar to get your API keys.Initialize the SDK
For full setup instructions, see the iOS SDK and Android SDK docs. Once the SDK is installed, initialize it.Set the user
When a professional logs in, set their user ID and any relevant metadata. This links all location updates and events to the professional in your system. iOS (Swift)metadata, like companyId, makes it easy to filter the data by company or team on the server side.
Request location permissions
This experience requires background location permissions so the SDK can track the professional’s location when the app is not in the foreground. Following these docs to request background permissions for iOS and Android.Steps
Create a geofence for the shift location
When a shift is created, create a geofence for its location. This will be used to detect when the professional arrives and departs.Use the Geofences API to create a geofence server-side when a shift is created. Link the geofence to the shift using an
externalId so you can reference it. Setting deleteAfter automatically deletes the geofence after the shift window, keeping your project clean without requiring a manual delete call. Start a trip when the professional begins traveling
When the professional taps “Start route,” start a Radar trip. Trips provide real-time ETA tracking, delay detection, and approaching signals - everything needed to power a live tracking view for a dispatcher or customer.iOS (Swift)Android (Kotlin)Setting
scheduledArrivalAt enables Radar’s delay detection: if the professional’s ETA exceeds the scheduled arrival time, Radar will automatically surface a delay signal. We recommend implementing silent push notifications alongside trip tracking to ensure location updates continue even if the professional manually terminates the app.Tracking frequencyRadar’s SDK supports custom tracking options as well as three tracking presets: EFFICIENT, RESPONSIVE, and CONTINUOUS. You can remotely set tracking options in the Radar dashboard, overriding any client-side specified tracking options.In addition to general tracking options, Radar supports overriding tracking behavior during a trip or inside a geofence with a specified tag.As a professional is on their way to a shift, we recommend:- On-trip tracking options: increase tracking frequency while a professional is actively on a trip using a modified version of the
CONTINUOUSpreset, withdesiredStoppedUpdateInterval: 60anddesiredMovingUpdateInterval: 60. - In-geofence tracking options: increase tracking frequency to every 30s via the base
CONTINUOUSpreset when a professional is inside ashiftgeofence to ensure accurate clock-in/out detection while on-site.
Handle trip signals
Trips stream real-time locations and ETA updates to your backend via webhooks. Use these events to power a dispatcher dashboard and/or customer-facing tracking view.Key trip events to listen for:
Offline behavior: If the professional loses connection during a trip, the SDK will buffer location updates and replay them once connectivity is restored. Your backend will receive the replayed locations in order, so no location data should be lost.No-show detection: As the professional travels,
| Event | Description |
|---|---|
user.started_trip | Professional is on their way |
user.updated_trip | Location or ETA updated |
user.approaching_trip_destination | Professional is within the approaching threshold |
user.arrived_at_trip_destination | Professional has arrived at the destination |
user.stopped_trip | Trip completed or canceled |
eta.duration is updated on each user.updated_trip event. If the ETA continues to increase over time rather than decrease, this may indicate the professional is moving away from the shift. You can implement custom no-show logic on your backend by tracking ETA trends across successive events and marking a shift as a no-show after a configurable threshold.Example user.updated_trip payload:Clock-in on geofence entry
When the professional enters the shift geofence, Radar triggers a Update the shift record in your system with the clock-in timestamp.
user.entered_geofence event. Use createdAt from the webhook payload at the clock-in timestamp.Clock-out on geofence exit
When the professional exits the shift geofence, Radar triggers a Time onsite =
user.exited_geofence event. Use createdAt as the clock-out timestamp and calculate the time onsite.exitedAt - enteredAtCalculate mileage for reimbursement
When the trip completes, pass it to Radar’s route matching API to calculate the distance traveled for mileage reimbursement.Request:Response:Use
distance.text to display the trip mileage to the dispatcher and distance.value to calculate reimbursement.