Skip to main content
This guide will walk you through installing the Radar iOS SDK in your iOS application.

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.
1

Install CocoaPods

If you don’t have CocoaPods installed, install it:
sudo gem install cocoapods
2

Create or update Podfile

In your project directory, create a Podfile (if you don’t have one) or add the Radar SDK:
platform :ios, '10.0'
use_frameworks!

target 'YourApp' do
  pod 'RadarSDK', '~> 3.27.0'
end
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:
pod install
After running pod install, always open your project using the .xcworkspace file, not the .xcodeproj file.

Configure Info.plist

The Radar SDK requires location permissions. Add the following keys to your Info.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.
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We use your location to provide location-based features and notifications.</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>We use your location to provide location-based features.</string>
Required: Both keys are required even if you only need foreground location access. Customize the descriptions to match your app’s use case.
2

Add motion usage description (optional)

If you want to use motion tracking for improved accuracy, add:
<key>NSMotionUsageDescription</key>
<string>We use motion data to improve location accuracy.</string>

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:
import RadarSDK
For Objective-C:
#import <RadarSDK/RadarSDK.h>

Initialize the SDK

Initialize the SDK in your AppDelegate before using any Radar methods:
import UIKit
import RadarSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        // Initialize Radar with your publishable key
        Radar.initialize(publishableKey: "prj_live_pk_...")
        
        return true
    }
}
Replace prj_live_pk_... with your actual publishable API key from the Radar dashboard.Never use your secret key in client-side code!

Advanced Initialization Options

You can pass additional options during initialization:
let options = RadarInitializeOptions()
options.autoLogNotificationConversions = true
options.autoHandleNotificationDeepLinks = true

Radar.initialize(publishableKey: "prj_live_pk_...", options: options)

Available Options

  • autoLogNotificationConversions: Automatically log conversions when users interact with notifications
  • autoHandleNotificationDeepLinks: Automatically open deep links from Radar notifications
  • silentPush: Enable silent push notifications for location updates

Verify Installation

To verify the SDK is installed correctly, check the SDK version:
print("Radar SDK version: \(Radar.sdkVersion)")
You should see output like:
Radar SDK version: 3.27.0

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

Build docs developers (and LLMs) love