Integrate the iOS SDK for MXO in your App

Before you can deploy the integration, you must ensure the SDK is set up with the correct initialization parameters.

You can download the latest SDK and review the extended integration instructions from Github:

iOS SDK for MXO

SDK Deployment Target

The SDK deployment target is iOS 9.0 or higher. If your deployment target is lower, please get in touch so we can understand how to best mitigate this.

Installation and Environment Setup

We provide the SDK as an embedded framework. You can integrate this using CocoaPods or by manually adding the framework to your project.

The aim of the of the automatic integration is to produce two build variants:

  1. Admin mode. Admin mode provides you with an interface that lets you add Activity Capture Points to interactions and elements, Attribute Capture Points to elements, and preview your configuration before publishing it to your live environment.

    The Admin mode build should only be distributed internally to business users involved in MXO setup. This is your internal dev build.

  2. User mode. The User mode build should be made available through the App Store, when you are satisfied that all insights are being tracked in Admin mode and internal QA requirements have been met. For more information, see Configure the SDK in User mode for App Store builds.

Step 1: Finding your Integration Parameters in MXO

You need to provide specific information about your MXO environment when integrating your mobile solution with the SDK. These integration parameters include:

  • Site Key (for your specific Space)
  • Touchpoint URI
  • API Key & Shared Secret (required for OAuth 1.0 authentication)
  • Username/User ID
  • Host name. Typically, this is https://na5.thunderhead.com or https://eu2.thunderhead.com.

For more information, see Find the Information required when Integrating MXO with your Mobile Solutions.

Step 2: Define the SDK Initialisation Parameters using the Integration Parameters for your Space

Initialize the SDK using the integration parameters specific to your MXO environment.

Example

// Initialization parameters example for your iOS app NSString *siteKey = @"ONE-XXXXXXXX-6100"; NSString *touchpointURI = @"ios://myiOSAppBaseURI"; // OAuth1 credentials and user id NSString *apiKey = @"2506c0b4-XXXX-XXXX-XXXX-2503e8e211c5"; NSString *sharedSecret = @"7d546df6-XXXX-XXXX-XXXX-0630d6bff23e"; NSString *userId = @"api@mytenancyname"; NSString *hostName = @"xxx.thunderhead.com"; 

Step 3: Initialize the SDK in Admin mode

Initialize the SDK in Admin mode and use this to create your Admin mode Build for internal distribution.

[One startSessionWithSK:siteKey uri:touchpointURI apiKey:apiKey sharedSecret:sharedSecret userId:userName adminmode:YES hostName:hostName]; 

Step 3: Initialize the SDK in User mode

Initialize the SDK in User mode and use this to create your User mode Build for publication to the Apple App Store.

[One startSessionWithSK:siteKey uri:touchpointURI apiKey:apiKey sharedSecret:sharedSecret userId:userName adminmode:NO hostName:hostName];