Documentation Index
Fetch the complete documentation index at: https://mintlify.com/radarlabs/radar-sdk-ios/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Radar’s trip tracking feature enables you to track journeys from origin to destination with real-time ETAs, status updates, and approaching/arrival events. Perfect for delivery, ride-sharing, and on-demand services.Understanding Trips
A trip represents a journey to a destination geofence. Trips include:- External ID: Your unique identifier for the trip
- Destination: A geofence tag or external ID
- Metadata: Custom key-value pairs
- Mode: Travel mode (car, bike, foot)
- Status: Current trip state (started, approaching, arrived, etc.)
- ETA: Real-time distance and duration to destination
- Scheduled arrival: Optional expected arrival time
- Multi-destination support: Multiple legs for complex routes
Trip Lifecycle
Trips progress through the following statuses:Started
Trip has been created and tracking has begun.Status:
RadarTripStatusStartedEvent: RadarEventTypeUserStartedTripApproaching
User is approaching the destination (within threshold).Status:
RadarTripStatusApproachingEvent: RadarEventTypeUserApproachingTripDestinationArrived
User has arrived at the destination geofence.Status:
RadarTripStatusArrivedEvent: RadarEventTypeUserArrivedAtTripDestinationStarting a Trip
Start a trip with destination geofence tag or external ID:Either
destinationGeofenceTag or destinationGeofenceExternalId is required. Both can be provided for additional matching.Starting with Custom Tracking Options
You can specify custom tracking options for the trip duration:Trip Options Reference
| Option | Type | Description |
|---|---|---|
externalId | String | Your unique identifier for the trip (required). |
destinationGeofenceTag | String? | Tag of the destination geofence. |
destinationGeofenceExternalId | String? | External ID of the destination geofence. |
mode | RadarRouteMode | Travel mode: .car, .bike, .foot, .truck, .motorbike (default: .car). |
metadata | [String: Any]? | Custom key-value pairs for the trip. |
scheduledArrivalAt | Date? | Expected arrival time. |
approachingThreshold | UInt16 | Distance threshold in meters for “approaching” status (default: 0, uses server default). |
startTracking | BOOL | Whether to automatically start tracking (default: true). |
legs | [RadarTripLeg]? | Array of trip legs for multi-destination trips. |
Updating a Trip
Manually update a trip’s options or status:Pass
RadarTripStatusUnknown to avoid updating the trip status when you only want to update other properties.Completing a Trip
Mark a trip as completed:Canceling a Trip
Cancel an active trip:Getting Current Trip
Retrieve the current active trip:Trip Events
Receive trip events through theRadarDelegate:
Multi-Destination Trips
For trips with multiple stops, use trip legs:Creating Multi-Destination Trips
Updating Trip Legs
Update the status of individual legs:Update Current Leg
Update the current active leg:Reordering Trip Legs
Reorder legs in a multi-destination trip:Trip Properties
Access trip properties from theRadarTrip object:
Use Cases
Food Delivery
Track delivery driver location and provide customers with real-time ETAs and approaching notifications.
Ride-Sharing
Monitor driver progress to pickup location and notify passengers when the driver is approaching.
Package Delivery
Track couriers across multiple delivery stops with multi-destination trip legs.
Field Services
Track technicians traveling to service appointments with arrival notifications.
Best Practices
Use Unique External IDs
Use your own unique identifiers (order IDs, delivery IDs) as the trip’s external ID for easy reference.
Set Appropriate Travel Modes
Choose the correct travel mode (car, bike, foot) for accurate ETA calculations.
Include Rich Metadata
Store order details, customer information, and other context in trip metadata for personalization.
For more details on trip tracking, visit the Radar documentation.