This repository contains the cocoapod for the Accurat SDK. You can find the instruction to integrate the Accurat SDK into your iOS app below.


  • Requirements
  • Configure project
  • Add SDK to project
  • Integrate SDK into app
  • Submit to App Store
  • Contact


  • iOS 8.0+
  • Xcode 8.3+
  • Swift 4+

Configure project

Add appropriate location usage descriptions to the Info.plist of your application. These strings will be displayed when prompting the user for background location permissions.

For Xcode 9:

<string>Allow location access to personalize your experience.</string>
<string>Allow location access to personalize your experience.</string>
<string>Allow location access to personalize your experience.</string>

Then, in your project settings, go to Capabilities > Background Modes and turn on Background fetch.

Add SDK to project


CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate Accurat into your Xcode project using CocoaPods, specify it in your Podfile:

source ''
platform :ios, '8.0'

target '&lt;Your Target Name&gt;' do
    pod 'Accurat', :git =&gt; ''

Then, run the following command:

$ pod install

Integrate SDK into app

Import the SDK (required)

import Accurat

Initialize SDK (required)

Initialize the SDK in your AppDelegate class before calling any other Accurat methods.

In application(_:didFinishLaunchingWithOptions:), call:

Accurat.shared.initialize(username: "ACCURAT_USERNAME", password: "ACCURAT_PASSWORD")

where ACCURAT_USERNAME and ACCURAT_PASSWORD are strings containing your Accurat username and password.

Additionally, implement the following method in your AppDelegate:

func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -&gt; Void) {

Start Tracking (required)

To start Accurat, call the startTracking method (also starts the consent flow, see GDPR):


It is recommended to implement this method in your AppDelegate after the initialize:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {

Stop Tracking (optional)

To stop Accurat, call the stopTracking method:


Is tracking enabled? (optional)

If you want to know if the tracking is enabled or not, call the isTrackingEnabled variable:


Set language (optional)

If you want to change the language of the user, you can update the language. This language will i.e. be used in the consent popups. When no language is, the device language is used.


GDPR (optional)

Before tracking the user's location, the user is asked to authorize location permissions for the app and give consent to use his location data.

If you want to start the consent flow separately from the tracking, call the askConsents method (also started by the tracking):

Accurat.shared.askConsents(onComplete: onComplete)

If you want to get the state of a consent, call the getConsentState method and provide a consent type:


If you want to update the state of a consent, call the updateConsent method and provide a consent type + state:

Accurat.shared.updateConsent(.tracking, state: 0/1)

Submit to App Store

Apple requires that you justify your use of background location. Add something materially similar to the following to the bottom of your App Store description: This app uses background location to personalize the experience of its users. Continued use of background location may decrease battery life.


Do you have any questions? E-mail us at