Integration Guide - Mobile SDKs

iOS SDK

Overview

Installation

Start the SDK

Send Location Updates

iOS Webview

Shopify Checkout Kit

Licensing

Changelog

Android SDK

Android SDK Overview

Installation

Start the SDK

Integration Guide

forterMobileUID

Social Network IDs

Send Location Updates

Android Webview

Shopify Checkout Kit

Play Store Compliance

Changelog

Integration Guide

Prerequisites

The ForterSDK requires initialization from your application's main context. If you haven't set up an Application class yet:

  1. Create an Application class
  2. Register it in your AndroidManifest.xml

Integration Steps

1. Initialize the SDK

Add the following initialization code to your Application class's onCreate() method:

// Get ForterSDK instance and initiate it with the application context
IForterSDK ftr = ForterSDK.getInstance();
ftr.init(this, AppConstants.FORTER_SITE_ID);

You will need to provide a valid Forter site ID (please use the test site ID only for debugging purposes)

Advanced configuration of the SDK can be done by initializing the SDK with a customized ForterSDKConfiguration. Please consult with your Forter Implementation Engineer before changing the default configuration.

2. Register Activity Lifecycle Callbacks

After initializing the SDK in the onCreate() method of your application class, please register our built-in activity lifecycle callbacks:

This step is only required for SDK versions below 3.0.0.

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
    registerActivityLifecycleCallbacks(ftr.getActivityLifecycleCallbacks());
}

Complete Integration Example

After performing the above steps, here's how your onCreate() method should look:

@Override
public void onCreate(){
    super.onCreate();
    String mobileId = ForterIntegrationUtils.getDeviceUID(this);

// Get ForterClient instance and initiate it
    IForterSDK ftr = ForterSDK.getInstance();
    ftr.init(this, AppConstants.FORTER_SITE_ID // your unique Forter site ID);

// Start generic activity-based navigation tracking (ForterSDK < 3.0.0)
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
        registerActivityLifecycleCallbacks(ftr.getActivityLifecycleCallbacks());
    }
}