Overview
The Radar iOS SDK provides flexible location tracking capabilities, from foreground tracking to continuous background tracking with configurable presets. You can track location once in the foreground, or start background tracking with options optimized for different use cases.Foreground Tracking
Track the user’s location once in the foreground usingtrackOnce().
Track with Custom Accuracy
You can specify desired accuracy and beacon ranging options:Accuracy Options
RadarTrackingOptionsDesiredAccuracyHigh- UseskCLLocationAccuracyBestRadarTrackingOptionsDesiredAccuracyMedium- UseskCLLocationAccuracyHundredMeters(default)RadarTrackingOptionsDesiredAccuracyLow- UseskCLLocationAccuracyKilometer
Track with Manual Location
You can manually update the user’s location:Background Tracking
Start background tracking with configurable options to monitor location continuously.Tracking Presets
Radar provides three built-in tracking presets optimized for different use cases:Continuous Tracking
Updates about every 30 seconds while moving or stopped. Moderate battery usage. Shows the flashing blue status bar during tracking.Use Cases: Real-time delivery tracking, ride-sharing, live location sharing
Responsive Tracking
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.Use Cases: Curbside pickup, fleet tracking, asset tracking
Location updates may be delayed significantly by Low Power Mode, or if the device has connectivity issues, low battery, or Wi-Fi disabled.
Custom Tracking Options
You can create custom tracking options for fine-grained control:Tracking Options Reference
| Option | Type | Description |
|---|---|---|
desiredStoppedUpdateInterval | int | Location update interval in seconds when stopped. Use 0 to shut down when stopped. |
desiredMovingUpdateInterval | int | Location update interval in seconds when moving. |
desiredSyncInterval | int | Sync interval in seconds. |
desiredAccuracy | RadarTrackingOptionsDesiredAccuracy | Desired accuracy of location updates (high, medium, low). |
stopDuration | int | Duration in seconds after which the device is considered stopped. |
stopDistance | int | Distance in meters within which the device is considered stopped. |
startTrackingAfter | NSDate? | When to start tracking. Use nil to start immediately. |
stopTrackingAfter | NSDate? | When to stop tracking. Use nil to track indefinitely. |
replay | RadarTrackingOptionsReplay | Which failed location updates to replay (stops, none, all). |
syncLocations | RadarTrackingOptionsSyncLocations | Which location updates to sync (all, stopsAndExits, none). |
showBlueBar | BOOL | Whether to show the flashing blue status bar when tracking. |
useStoppedGeofence | BOOL | Use iOS region monitoring to create a geofence when stopped. |
stoppedGeofenceRadius | int | Radius in meters of the geofence when stopped. |
useMovingGeofence | BOOL | Use iOS region monitoring to create a geofence when moving. |
movingGeofenceRadius | int | Radius in meters of the geofence when moving. |
syncGeofences | BOOL | Sync nearby geofences from server to improve responsiveness. |
useVisits | BOOL | Use the iOS visit monitoring service. |
useSignificantLocationChanges | BOOL | Use the iOS significant location change service. |
beacons | BOOL | Monitor beacons. |
useMotion | BOOL | Use the iOS motion activity service. |
usePressure | BOOL | Use the iOS pressure service. |
Stop Tracking
Stop background tracking:Check Tracking Status
Check if tracking has been started:Get Current Tracking Options
Retrieve the current tracking options:Get Location
Get the device’s current location without tracking:Mock Tracking for Testing
Simulate user movement for testing:Anonymous Tracking
Enable anonymous tracking to avoid creating user records on the server:Listening for Events
Implement theRadarDelegate protocol to receive location updates and events client-side:
Best Practices
Choose the Right Preset
Select a tracking preset based on your use case. Continuous for real-time tracking, Responsive for balanced updates, Efficient for visit-based tracking.
Request Permissions
Request location permissions before starting tracking. Use
requestAlwaysAuthorization() for background tracking.Test with Mock Tracking
Use mock tracking during development to simulate user movement and test your integration.
Monitor Battery Usage
Balance location accuracy and update frequency with battery usage. Use Efficient preset for best battery life.
For more details on tracking, visit the Radar documentation.