Mobile SDK integration guide

Overview of flow

Mobile SDK integration flow

Supported SDKs

We natively support iOS, Android, React Native, Flutter, and Cordova. You will find the sample apps for our native SDKs below:

Requirements

  • Swift 5.

  • iOS 13 and above.

  • Xcode 13 and above.

Getting started

Get started with our user guide for an overview of our core platform and its multiple features, or browse the API reference for fine-grained documentation of all our services.

1. Install the SDK

CocoaPods

  1. Before using the ComplyCube SDK, install the CocoaPods plugin by running the following command in your terminal:

  2. Add plugin repos and install the pod using your Podfile:

Application permissions

Our SDK uses the device camera and microphone for capture. You must add the following keys to your application Info.plist file.

  1. NSCameraUsageDescription

  1. NSMicrophoneUsageDescription

2. Create a client

Before launching the SDK, your app must first create a client using the ComplyCube API.

A client represents the individual you need to perform identity verification checks on. This must be done on your mobile app backend server, not the mobile app itself.

Example request

Example response

The response will contain an id (the Client ID), which is required for the next step.

3. Generate an SDK token

SDK Tokens enable clients to send personal data securely from your mobile app to ComplyCube. Learn more about our SDK Token endpoint.

You must generate a new token each time you initialize the ComplyCube Mobile SDK.

Example request

Example response

4. Prepare the stages

Set up the stages you wish to include in your flow.

5. Initialize an SDK flow

You can now initialize a flow by setting the SDK Token, Client ID, and the flow stages. The sequence of stages you specify determines the order in which your client sees those stages.

6. Perform checks

Using the results returned in the onSuccess callback, you can trigger your mobile backend to run the necessary checks on your client.

For example, use the result of a selfie and document capture as follows:

Example request for a Document Check

7. Retrieve results

Your mobile backend can retrieve all check results using our API.

All our checks are asynchronous. If you have set up webhooks as described in our webhooks guide, you will be notified once a check completes.

To retrieve the check results, you can perform a get check request.

Example request

Stages

Each stage in the flow can be customized to create the ideal journey for your clients.

The snippet below demonstrates how to set up a customized flow using the ComplyCube Mobile SDK.

Learn more about our Mobile SDK stages.

Look and feel

The SDK allows you to set colors to match your existing application or brand. You can customize the colors by setting the relevant values when building your flow.

Learn more about our appearance properties.

Creating a custom appearance

Before initiating the flow, create your own custom design and integrate it into your Flow Builder.

Applying your custom appearance

Set the custom appearance that you have created using the Flow Builder.

Appearance properties

Appearance Property
Description

primaryButtonBgColor

Primary action button background color.

primaryButtonPressedBgColor

Primary action button pressed background color.

primaryButtonTextColor

Primary action button text color.

primaryButtonBorderColor

Primary action button border color.

secondaryButtonBgColor

Secondary button background color.

secondaryButtonPressedBgColor

Secondary action button pressed background color.

secondaryButtonTextColor

Secondary action button text color.

secondaryButtonBorderColor

Secondary action button border color.

documentTypeSelectorBgColor

Document type selection button color.

documentTypeSelectorBorderColor

Document type selection button border color.

documentTypeSelectorTiteTextColor

Document type selection title text color.

documentTypeSelectorDescriptionTextColor

Document type selection description text color.

documentTypeSelectorIconColor

Document type selection icon color.

bodyTextColor

Screen body text color.

linkButtonTextColor

Links color.

headingTextColor

Title heading text color.

subheadingTextColor

Subheading text color.

infoPanelTitleColor

Information panel title color.

infoPanelDescriptionTextColor

Information panel description text color.

infoPanelBgColor

Information panel background color.

infoPanelIconColor

Information panel icon color.

errorPanelTitleColor

Error panel title color.

errorPanelDescriptionTextColor

Error panel description text color.

errorPanelBgColor

Error panel background color.

errorPanelIconColor

Error panel icon color.

cameraButtonBgColor

Camera capture button background color.

uiInterfaceStyle

Set the SDK to use dark mode, light mode, or system Inherited.

Localization

The SDK provides the following international language support:

  • Arabic - ar 🇦🇪

  • Chinese (Simplified) - zh 🇨🇳

  • Chinese (Traditional) - hk 🇨🇳

  • Dutch - nl 🇳🇱

  • English - en 🇺🇸

  • French - fr 🇫🇷

  • German - de 🇩🇪

  • Hindi - hi 🇮🇳

  • Indonesian - id 🇮🇩

  • Italian - it 🇮🇹

  • Japanese - ja 🇯🇵

  • Korean - ko 🇰🇷

  • Norwegian - no 🇳🇴

  • Polish - po 🇵🇱

  • Portuguese - pt 🇵🇹

  • Spanish - es 🇪🇸

  • Swedish - sv 🇸🇪

  • Thai - th 🇹🇭

  • Vietnamese - vi 🇻🇳

Result handling

To handle results you must implement the success, cancelled or error callbacks.

Upon an "on success" callback, you can initiate check requests directly from your mobile app backend server. This can be done using the IDs of the uploaded resources, returned in the result parameter.

If the SDK experiences any issues, the "on error" callback will return a ComplyCubeError. Learn more about our Mobile SDK error codes.

If the client exits the SDK flow before completion, the description provided by the "on cancelled" callback will specify the reason.

It's possible that the client advanced as far as the upload stage before choosing to cancel. In such cases, some data may already have been uploaded to their record.

Events tracking

The SDK tracks an array of events across the various stages of a flow.

If you want to implement your own user tracking, the SDK enables you to insert your custom tracking code for the tracked events.

To incorporate your own tracking, define a function and apply it using withEventHandler when initializing the FlowBuilder:

Token expiry handling

If you want to automatically manage token expiration, you can use a callback function to generate a new token and seamlessly continue the process with it.

Last updated

Was this helpful?