Skip to main content
RadarTrackingOptions is a configuration class used to control background tracking behavior. It provides fine-grained control over location update intervals, accuracy, sync behavior, and iOS location services.

Properties

desiredStoppedUpdateInterval
int
Determines the desired location update interval in seconds when stopped. Use 0 to shut down when stopped.
Location updates may be delayed significantly by Low Power Mode, or if the device has connectivity issues, low battery, or Wi-Fi disabled.
desiredMovingUpdateInterval
int
Determines the desired location update interval in seconds when moving.
Location updates may be delayed significantly by Low Power Mode, or if the device has connectivity issues, low battery, or Wi-Fi disabled.
desiredSyncInterval
int
Determines the desired sync interval in seconds.
desiredAccuracy
RadarTrackingOptionsDesiredAccuracy
Determines the desired accuracy of location updates.Values:
  • RadarTrackingOptionsDesiredAccuracyHigh - Uses kCLLocationAccuracyBest
  • RadarTrackingOptionsDesiredAccuracyMedium - Uses kCLLocationAccuracyHundredMeters (default)
  • RadarTrackingOptionsDesiredAccuracyLow - Uses kCLLocationAccuracyKilometer
stopDuration
int
With stopDistance, determines the duration in seconds after which the device is considered stopped.
stopDistance
int
With stopDuration, determines the distance in meters within which the device is considered stopped.
startTrackingAfter
NSDate
Determines when to start tracking. Use nil to start tracking when startTracking is called.
stopTrackingAfter
NSDate
Determines when to stop tracking. Use nil to track until stopTracking is called.
replay
RadarTrackingOptionsReplay
Determines which failed location updates to replay to the server.Values:
  • RadarTrackingOptionsReplayStops - Replays failed stops
  • RadarTrackingOptionsReplayNone - Replays no failed location updates
  • RadarTrackingOptionsReplayAll - Replays all failed location updates
syncLocations
RadarTrackingOptionsSyncLocations
Determines which location updates to sync to the server.Values:
  • RadarTrackingOptionsSyncAll - Syncs all location updates to the server
  • RadarTrackingOptionsSyncStopsAndExits - Syncs only stops and exits to the server
  • RadarTrackingOptionsSyncNone - Syncs no location updates to the server
showBlueBar
BOOL
Determines whether the flashing blue status bar is shown when tracking.See Apple’s documentation for more details.
useStoppedGeofence
BOOL
Determines whether to use the iOS region monitoring service (geofencing) to create a client geofence around the device’s current location when stopped.See Apple’s documentation on region monitoring for more details.
stoppedGeofenceRadius
int
Determines the radius in meters of the client geofence around the device’s current location when stopped.
useMovingGeofence
BOOL
Determines whether to use the iOS region monitoring service (geofencing) to create a client geofence around the device’s current location when moving.See Apple’s documentation on region monitoring for more details.
movingGeofenceRadius
int
Determines the radius in meters of the client geofence around the device’s current location when moving.
syncGeofences
BOOL
Determines whether to sync nearby geofences from the server to the client to improve responsiveness.
useVisits
BOOL
Determines whether to use the iOS visit monitoring service.See Apple’s documentation on visit monitoring for more details.
useSignificantLocationChanges
BOOL
Determines whether to use the iOS significant location change service.See Apple’s documentation on significant location changes for more details.
beacons
BOOL
Determines whether to monitor beacons.
useIndoorScan
BOOL
Determines whether to use indoor scanning.
useMotion
BOOL
Determines whether to use the iOS motion activity service.
usePressure
BOOL
Determines whether to use the iOS pressure service.

Preset Configurations

Radar provides three preset tracking configurations optimized for common use cases.

presetContinuous

let options = RadarTrackingOptions.presetContinuous()
RadarTrackingOptions *options = [RadarTrackingOptions presetContinuous];
Updates about every 30 seconds while moving or stopped. Moderate battery usage. Shows the flashing blue status bar during tracking. Configuration:
  • desiredStoppedUpdateInterval: 30 seconds
  • desiredMovingUpdateInterval: 30 seconds
  • desiredSyncInterval: 20 seconds
  • desiredAccuracy: High
  • stopDuration: 140 seconds
  • stopDistance: 70 meters
  • syncLocations: All
  • replay: None
  • showBlueBar: YES
  • useStoppedGeofence: NO
  • useMovingGeofence: NO
  • syncGeofences: YES
  • useVisits: NO
  • useSignificantLocationChanges: NO

presetResponsive

let options = RadarTrackingOptions.presetResponsive()
RadarTrackingOptions *options = [RadarTrackingOptions presetResponsive];
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. Requires the location background mode.
Location updates may be delayed significantly by Low Power Mode, or if the device has connectivity issues, low battery, or Wi-Fi disabled.
Configuration:
  • desiredStoppedUpdateInterval: 0 seconds (shut down when stopped)
  • desiredMovingUpdateInterval: 150 seconds
  • desiredSyncInterval: 20 seconds
  • desiredAccuracy: Medium
  • stopDuration: 140 seconds
  • stopDistance: 70 meters
  • syncLocations: All
  • replay: Stops
  • showBlueBar: NO
  • useStoppedGeofence: YES (100m radius)
  • useMovingGeofence: YES (100m radius)
  • syncGeofences: YES
  • useVisits: YES
  • useSignificantLocationChanges: YES

presetEfficient

let options = RadarTrackingOptions.presetEfficient()
RadarTrackingOptions *options = [RadarTrackingOptions presetEfficient];
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.
Location updates may be delayed significantly by Low Power Mode, or if the device has connectivity issues, low battery, or Wi-Fi disabled.
See Apple’s documentation on visit monitoring for more details. Configuration:
  • desiredStoppedUpdateInterval: 0 seconds
  • desiredMovingUpdateInterval: 0 seconds
  • desiredSyncInterval: 0 seconds
  • desiredAccuracy: Medium
  • stopDuration: 0 seconds
  • stopDistance: 0 meters
  • syncLocations: All
  • replay: Stops
  • showBlueBar: NO
  • useStoppedGeofence: NO
  • useMovingGeofence: NO
  • syncGeofences: YES
  • useVisits: YES
  • useSignificantLocationChanges: NO

Class Methods

trackingOptionsFromDictionary

class func trackingOptions(from dictionary: [AnyHashable : Any]) -> RadarTrackingOptions?
+ (RadarTrackingOptions *_Nullable)trackingOptionsFromDictionary:(NSDictionary *_Nonnull)dictionary;
Creates a RadarTrackingOptions instance from a dictionary.
dictionary
NSDictionary
required
A dictionary containing tracking options configuration.
Returns: A RadarTrackingOptions instance, or nil if the dictionary is invalid.

stringForDesiredAccuracy

class func string(for desiredAccuracy: RadarTrackingOptionsDesiredAccuracy) -> String
+ (NSString *)stringForDesiredAccuracy:(RadarTrackingOptionsDesiredAccuracy)desiredAccuracy;
Converts a desired accuracy enum value to its string representation.

desiredAccuracyForString

class func desiredAccuracy(for string: String) -> RadarTrackingOptionsDesiredAccuracy
+ (RadarTrackingOptionsDesiredAccuracy)desiredAccuracyForString:(NSString *)str;
Converts a string to a desired accuracy enum value.

stringForReplay

class func string(for replay: RadarTrackingOptionsReplay) -> String
+ (NSString *)stringForReplay:(RadarTrackingOptionsReplay)replay;
Converts a replay enum value to its string representation.

replayForString

class func replay(for string: String) -> RadarTrackingOptionsReplay
+ (RadarTrackingOptionsReplay)replayForString:(NSString *)str;
Converts a string to a replay enum value.

stringForSyncLocations

class func string(forSyncLocations syncLocations: RadarTrackingOptionsSyncLocations) -> String
+ (NSString *)stringForSyncLocations:(RadarTrackingOptionsSyncLocations)syncLocations;
Converts a sync locations enum value to its string representation.

syncLocationsForString

class func syncLocations(for string: String) -> RadarTrackingOptionsSyncLocations
+ (RadarTrackingOptionsSyncLocations)syncLocationsForString:(NSString *)str;
Converts a string to a sync locations enum value.

Instance Methods

dictionaryValue

func dictionaryValue() -> [AnyHashable : Any]
- (NSDictionary *)dictionaryValue;
Converts the tracking options instance to a dictionary representation. Returns: A dictionary containing all tracking options properties.

Usage Example

// Use a preset
Radar.startTracking(trackingOptions: .presetResponsive())

// Or customize options
let options = RadarTrackingOptions.presetResponsive()
options.desiredMovingUpdateInterval = 120
options.showBlueBar = true
Radar.startTracking(trackingOptions: options)
// Use a preset
[Radar startTrackingWithOptions:[RadarTrackingOptions presetResponsive]];

// Or customize options
RadarTrackingOptions *options = [RadarTrackingOptions presetResponsive];
options.desiredMovingUpdateInterval = 120;
options.showBlueBar = YES;
[Radar startTrackingWithOptions:options];

Build docs developers (and LLMs) love