iOS Setup

Installation

The Rover SDK is a collection of frameworks written in Swift. Instead of a single monolithic framework, the Rover SDK takes a modular approach, allowing you to include only the functionality relevant to your application. The SDK source code 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.

SwiftPM Repo Dialog Box

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

Latest SDK Version

Look at the GitHub releases pages for the changelog of available versions.

Then, in the subsequent dialog box, choose the Package Products (frameworks) you wish to use.

SwiftPM Target Dialog Box

Rover has multiple modules to choose from. RoverFoundation, RoverData, RoverNotifications, RoverDebug, and RoverUI are required. You add those to your app's main target here.

The RoverAppExtensions module is intended for use in an iOS Notification Extension, which enables several enhanced features for Rover push. Setting that up is addressed in a later step in the developer documentation, and it should be left off for now.

There are also several other modules that feature integrations with third party ticket and data solutions (RoverTicketmaster, RoverSeatgeek, and RoverAdobeExperience) and are similar covered later in the developer documentation.

Initialize the Rover SDK

The shared Rover instance is initialized with a set of assemblers. Each assembler has its own parameters but the only one that is required is the accountToken parameter on the DataAssembler.

You can learn more about assemblers and their parameters at Customizing Services.

You can find your accountToken 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

From within your application(_:didFinishLaunchingWithOptions:) method call the Rover.initialize(assemblers:) method passing in the assemblers for each of the Rover modules you want to use. Replace YOUR_SDK_TOKEN in the below code sample with the token you copied from the Rover Settings app.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // ...
    // Initialize Rover with its modules
    Rover.initialize(assemblers: [
        FoundationAssembler(),
        DataAssembler(accountToken: "YOUR_SDK_TOKEN"),
        UIAssembler(),
        ExperiencesAssembler(),
        NotificationsAssembler(),
        LocationAssembler(),
        DebugAssembler()
    ])
    return true
}