Overview
RadarTrackingOptions allows you to configure how the Radar SDK tracks location in the background. You can use preset configurations optimized for different use cases or create custom options to fine-tune tracking behavior.
Presets
Radar provides three preset tracking options optimized for common scenarios:Continuous
Updates about every 30 seconds while moving or stopped. Moderate battery usage. Shows the flashing blue status bar during tracking.desiredStoppedUpdateInterval: 30 secondsdesiredMovingUpdateInterval: 30 secondsdesiredAccuracy: HighshowBlueBar:trueuseStoppedGeofence:falseuseMovingGeofence:falseuseVisits:false
Responsive
Updates about every 2.5 minutes when moving and shuts down when stopped to save battery. Once stopped, the device will need to move more than 100 meters to wake up and start moving again. Low battery usage.desiredStoppedUpdateInterval: 0 (shuts down when stopped)desiredMovingUpdateInterval: 150 secondsdesiredAccuracy: MediumshowBlueBar:falseuseStoppedGeofence:truewith 100m radiususeMovingGeofence:truewith 100m radiususeVisits:trueuseSignificantLocationChanges:true
Location updates may be delayed significantly by Low Power Mode, or if the device has connectivity issues, low battery, or Wi-Fi disabled.
Efficient
Uses the iOS visit monitoring service to update only on stops and exits. Once stopped, the device will need to move several hundred meters and trigger a visit departure to wake up and start moving again. Lowest battery usage.desiredStoppedUpdateInterval: 0desiredMovingUpdateInterval: 0desiredAccuracy: MediumuseVisits:truesyncGeofences:truereplay: Stops
Custom Options
You can create custom tracking options by initializing aRadarTrackingOptions object and setting individual properties:
Configuration Properties
Update Intervals
desiredStoppedUpdateInterval
desiredStoppedUpdateInterval
Determines the desired location update interval in seconds when stopped. Set to
0 to shut down when stopped.Type: IntdesiredMovingUpdateInterval
desiredMovingUpdateInterval
Determines the desired location update interval in seconds when moving.Type:
IntdesiredSyncInterval
desiredSyncInterval
Determines the desired sync interval in seconds for sending location updates to the server.Type:
IntAccuracy
desiredAccuracy
desiredAccuracy
Determines the desired accuracy of location updates.Type:
RadarTrackingOptionsDesiredAccuracyOptions:.high- UseskCLLocationAccuracyBest.medium- UseskCLLocationAccuracyHundredMeters(default).low- UseskCLLocationAccuracyKilometer
Stop Detection
stopDuration
stopDuration
With
stopDistance, determines the duration in seconds after which the device is considered stopped.Type: IntstopDistance
stopDistance
With
stopDuration, determines the distance in meters within which the device is considered stopped.Type: IntScheduling
startTrackingAfter
startTrackingAfter
Determines when to start tracking. Use
nil to start tracking immediately when startTracking() is called.Type: Date?stopTrackingAfter
stopTrackingAfter
Determines when to stop tracking. Use
nil to track until stopTracking() is called.Type: Date?Sync Options
syncLocations
syncLocations
Determines which location updates to sync to the server.Type:
RadarTrackingOptionsSyncLocationsOptions:.all- Syncs all location updates (default).stopsAndExits- Syncs only stops and exits.none- Syncs no location updates
replay
replay
Determines which failed location updates to replay to the server when connectivity is restored.Type:
RadarTrackingOptionsReplayOptions:.stops- Replays failed stops.none- Replays no failed location updates.all- Replays all failed location updates
iOS Services
useStoppedGeofence
useStoppedGeofence
Determines whether to use iOS region monitoring to create a client geofence around the device’s current location when stopped.Type:
BoolSee Apple’s documentation for more information.stoppedGeofenceRadius
stoppedGeofenceRadius
Determines the radius in meters of the client geofence around the device’s current location when stopped.Type:
IntuseMovingGeofence
useMovingGeofence
Determines whether to use iOS region monitoring to create a client geofence around the device’s current location when moving.Type:
BoolmovingGeofenceRadius
movingGeofenceRadius
Determines the radius in meters of the client geofence around the device’s current location when moving.Type:
IntuseVisits
useVisits
Determines whether to use the iOS visit monitoring service for detecting significant location changes.Type:
BoolSee Apple’s documentation for more information.useSignificantLocationChanges
useSignificantLocationChanges
Determines whether to use the iOS significant location change service.Type:
BoolSee Apple’s documentation for more information.showBlueBar
showBlueBar
Determines whether the flashing blue status bar is shown when tracking in the background.Type:
BoolSee Apple’s documentation for more information.Advanced Options
syncGeofences
syncGeofences
Determines whether to sync nearby geofences from the server to the client to improve responsiveness.Type:
Boolbeacons
beacons
Determines whether to monitor beacons for proximity detection.Type:
BooluseIndoorScan
useIndoorScan
Determines whether to use indoor scanning for improved indoor location accuracy.Type:
BooluseMotion
useMotion
Determines whether to use the iOS motion activity service for better movement detection.Type:
BoolusePressure
usePressure
Determines whether to use the iOS pressure service for altitude detection.Type:
BoolGetting Current Options
You can retrieve the current tracking options:Battery Optimization
To optimize battery usage while maintaining location accuracy:Choose the right preset
Start with a preset that matches your use case:
- Use Efficient for geofencing-only applications
- Use Responsive for delivery or on-demand apps
- Use Continuous only when real-time tracking is critical
Tune update intervals
Increase
desiredMovingUpdateInterval to reduce location updates when moving. Set desiredStoppedUpdateInterval to 0 to shut down when stopped.Use geofences
Enable
useStoppedGeofence and useMovingGeofence to leverage iOS region monitoring instead of continuous location updates.Lower accuracy when possible
Use
.medium or .low accuracy if your use case doesn’t require high precision.Best Practices
Start with a preset
Begin with a preset and customize only what you need. Presets are battle-tested for common scenarios.
Test on real devices
Battery impact varies significantly between device models. Test your configuration on actual hardware.
Monitor battery usage
Use Xcode’s Energy Log instrument to measure your app’s energy impact.
Respect Low Power Mode
Location updates are automatically throttled by iOS in Low Power Mode. Design your app to handle delayed updates gracefully.