Prerequisites
Before you begin, make sure you have:- Xcode 12.0 or later
- iOS 10.0+ deployment target
- A Radar account with a publishable API key (sign up here)
Installation Methods
The Radar iOS SDK can be installed using CocoaPods or Swift Package Manager.- CocoaPods
- Swift Package Manager
1
Install CocoaPods
If you don’t have CocoaPods installed, install it:
2
Create or update Podfile
In your project directory, create a
Podfile (if you don’t have one) or add the Radar SDK:The current version is 3.27.0. Check radar.com for the latest version.
3
Install the SDK
Run the following command in your project directory:
Configure Info.plist
The Radar SDK requires location permissions. Add the following keys to yourInfo.plist file:
1
Add location usage descriptions
Add usage description strings that explain why your app needs location access. These are shown to users in permission prompts.
2
Add motion usage description (optional)
If you want to use motion tracking for improved accuracy, add:
Enable Background Modes
If you need background location tracking, enable the Location updates background mode:1
Open project settings
In Xcode, select your project in the Project Navigator.
2
Select your target
Select your app target from the TARGETS list.
3
Enable background modes
Go to the Signing & Capabilities tab.Click + Capability and add Background Modes.Check Location updates.
This allows your app to receive location updates while running in the background, which is required for features like geofencing and background tracking.
Import the SDK
In your Swift files, import the Radar SDK:Initialize the SDK
Initialize the SDK in yourAppDelegate before using any Radar methods:
Advanced Initialization Options
You can pass additional options during initialization:Available Options
autoLogNotificationConversions: Automatically log conversions when users interact with notificationsautoHandleNotificationDeepLinks: Automatically open deep links from Radar notificationssilentPush: Enable silent push notifications for location updates
Verify Installation
To verify the SDK is installed correctly, check the SDK version:Minimum iOS Version
The Radar iOS SDK supports:- iOS 10.0+ for Swift Package Manager
- iOS 12.0+ for CocoaPods (recommended)
While the SDK supports iOS 10.0+, we recommend targeting iOS 12.0+ for the best experience and full feature support.
Next Steps
Now that you’ve installed the SDK, you’re ready to start tracking location!Quickstart
Complete your first location tracking implementation