RadarTrip represents a trip that has been started with Radar’s trip tracking feature. It contains information about the trip’s destination, status, ETA, and metadata. Trip objects are returned in location callbacks and can be accessed via RadarUser.trip.
Properties
String
The Radar ID of the trip. This is assigned by the server when the trip is created.
String
The external ID of the trip. This is the unique ID you provided when creating the trip.
NSDictionary
The optional set of custom key-value pairs for the trip. This contains any custom data attached to the trip.
String
For trips with a destination, the tag of the destination geofence.
String
For trips with a destination, the external ID of the destination geofence.
RadarCoordinate
For trips with a destination, the location of the destination geofence. Contains latitude and longitude coordinates.
RadarRouteMode
The travel mode for the trip. Used to calculate ETA and distance.Values:
RadarRouteModeFoot- WalkingRadarRouteModeBike- BikingRadarRouteModeCar- DrivingRadarRouteModeTruck- TruckRadarRouteModeMotorbike- Motorcycle
float
For trips with a destination, the distance to the destination geofence in meters based on the travel mode for the trip.
float
For trips with a destination, the ETA to the destination geofence in minutes based on the travel mode for the trip.
RadarTripStatus
The status of the trip.Values:
RadarTripStatusUnknown- Unknown statusRadarTripStatusStarted- Trip has been startedRadarTripStatusApproaching- Device is approaching the destination (within the approaching threshold)RadarTripStatusArrived- Device has arrived at the destinationRadarTripStatusExpired- Trip has expiredRadarTripStatusCompleted- Trip has been completedRadarTripStatusCanceled- Trip has been canceled
NSArray<RadarTripOrder *>
The optional array of trip orders associated with this trip. Orders provide additional context about deliveries or pickups.
NSArray<RadarTripLeg *>
For multi-destination trips, the array of trip legs. Each leg represents a stop along the trip route and contains destination info, status, and metadata.Use
leg._id when calling updateTripLeg.See RadarTripLeg for more details.String
For multi-destination trips, the ID of the current active leg. This identifies which leg the device is currently traveling to.
Initializers
initWithObject
RadarTrip instance from a server response object.
id
required
A dictionary object from the server containing trip data.
RadarTrip instance, or nil if the object is invalid.
Instance Methods
dictionaryValue
Status Lifecycle
A trip progresses through several statuses during its lifecycle:- Started - The trip has been created and tracking has begun
- Approaching - The device is within the approaching threshold of the destination
- Arrived - The device has reached the destination geofence
- Completed - The trip has been manually completed
- Canceled - The trip has been manually canceled
- Expired - The trip has expired (typically after being in arrived state)
Usage Examples
Accessing the Current Trip
Monitoring Trip Status
Working with Multi-Destination Trips
Related
- RadarTripOptions - Configure and start trips
- RadarTripLeg - Multi-destination trip legs
- Trip Tracking Guide - Complete guide to trip tracking