Installation and Initialization

The Rover SDK is a Cocoa Touch Framework written in Swift. The SDK is 100% open-source and available on GitHub.


Install the SDK

SwiftPM

The recommended way to install the Rover SDK is via SwiftPM.

In Xcode, in your Project Settings, under Package Dependencies, add a new dependency with the URL of this repository: https://github.com/roverplatform/rover-ios.

Note that as of Xcode 13, you have to type the repository URL into the search box and press return.

Leave the dependency rule at the default, “Up To Next Major Version”. Rover follows the standard semver semantic versioning rules.

Cocoapods

As an alternative, you can use Cocoapods.

Add the Rover dependency to your Podfile.

pod 'Rover', '~> 3.8.2'

Initialization

You must initialize the Rover SDK with your account token. You can find your account token in the Rover Settings app. Find the token labelled “SDK Token” and click the icon next to it to copy it to your clipboard.

Settings App

Import Rover in your app delegate and set the accountToken variable from within your application(_:didFinishLaunchingWithOptions:) method.

import Rover

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // ...
    Rover.accountToken = "<YOUR_SDK_TOKEN>"
    // ...
}