Mobile SDK integration guide
Overview of 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.
Android 5.0 (API level 21) and above.
AndroidX.
Kotlin 1.7 and above.
React Native 0.71 and above.
Please review the iOS and Android requirements.
Flutter 3.3.0 and above.
Dart 3.1.3 and above.
Please review the iOS and Android requirements.
Please review the iOS and Android requirements.
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
Before using the ComplyCube SDK, install the CocoaPods plugin by running the following command in your terminal:
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.
NSCameraUsageDescription
NSMicrophoneUsageDescription
Our SDK requires the following repositories.
Install the React Native library by running:
⚠️ Sentry Integration
If you’re integrating Sentry into your React Native project, you might encounter the following compiler error:
This issue occurs due to a version incompatibility between the Sentry React Native package and the native Sentry SDK.
To resolve this error (as of @sentry/react-native v5.31.0 and iOS Sentry v8.36.0), update the import statements in your code:
In
SentrySdkInfo.handSentryInternalSerializable.h, replace:
Install the ComplyCube Flutter package by running:
Android
Complete the steps in the Android tab.
⚠️ iOS Deployment Targeting
If you’re targeting a specific iOS version above 13.0 for any of your dependencies, and you face the following error:
You can use the following snippet in your PodFile post_install script.
Configure your npm registry to use the ComplyCube SDK repository by running the following command in your terminal:
Modify the
.npmrcfile in your home directory by adding the settings copied from jFrog to the file.
Install the Cordova library by running:
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.
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:
result.documentIdto run a Document Check.result.documentIdandresult.livePhotoIdto run an Identity Check.
Using the StageResults returned by the flow, 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:
StageResult.Document.Idto run a Document Check.StageResult.Document.IdandStageResult.LivePhoto.Idto run an Identity Check.
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:
result.documentIdto run a Document Check.result.documentIdandresult.livePhotoIdto run an Identity Check.
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:
result.documentIdto run a Document Check.result.documentIdandresult.livePhotoIdto run an Identity Check.
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:
result.documentIdto run a Document Check.result.documentIdandresult.livePhotoIdto run an Identity Check.
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.
To disable the header display in the ComplyCube SDK Widget on Android, please insert the following line into styles.xml:
Appearance properties
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.
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:
To incorporate your own tracking, define a function and apply it using withEventHandler when initializing the Builder:
To incorporate your own tracking, define a function and apply it using the eventHandler property in your settings:
To incorporate your own tracking, define a function and apply it using the onCustomEvent property when initializing the Flutter widget:
To incorporate your own tracking, define a function and apply it using the eventHandler property in your settings:
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?




