API Reference

This page will guide you to integrate and verify Contlo SDK in your iOS application.

Prerequisites

To start the SDK integration, you must first create an API key and install the Mobile Push app from the Contlo App market. Go to your Contlo Dashboard and follow the steps below:

Create an API key

  1. Go to your profile section at the top right corner and click Settings.
  2. Go to Accounts > Store Settings from the sidebar on the Settings homepage.
  3. Go to the API keys tab on the Store Settings page and click Create key on the Private API keys section.
  1. Copy the newly created API key to add it later during the SDK integration.

Install Mobile push

  1. Go to App Market from the sidebar and search Mobile Push
  2. Click Install.

Installation

To install the Contlo SDK in your iOS project, follow the steps below:

  1. Install CocoaPods for your project.
  2. Once you have set CocoaPods for your project, enter the following command in the terminal to install the Contlo iOS SDK:
pod install Contlo-iOS-SDK
  1. To use the Contlo SDK in your iOS project, import the SDK in the respective file as shown below:
import Contlo_iOS_SDK

Initialization

Once the installation is complete, follow the steps below to initialize the Contlo SDK:

  1. Open the AppDelegate file and import the iOS SDK as shown below:
import Contlo_iOS_SDK
  1. On the same file, under the application() function, add the Contlo's initialize() method and pass the API key (created from the Contlo dashboard) as the parameter.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        Contlo.initialize(apiKey: "<ypur-api-key>")
        return true
    }

Verify Integration:

After initializing the SDK, open your application on a device or emulator.

Go to the Audiences section on your Contlo dashboard. You would see a new anonymous user is created.

You have successfully integrated the Contlo iOS SDK.

Welcome aboard!