Docs
API referenceComplianceSupportHomeLog inSign up
  • Introduction
  • Guides
    • API Quick Guide
      • Perform AML Screening
      • Perform Document Check
      • Perform Identity Check
      • Perform Proof of Address Check
      • Perform Multi-Bureau Check
    • Web Portal Quick Guide
      • Perform AML Screening
      • Perform Document Check
      • Perform Multi-Bureau Check
      • Send verification link to client
    • Web SDK Guide
      • Web SDK integration guide
      • Web SDK customizations
    • Mobile SDK Guide
      • Mobile SDK integration guide
      • Mobile SDK stages
      • Mobile SDK tracked events
      • Mobile SDK error codes
    • Hosted Solution Guide
      • Integration guide
    • Postman Guide
    • Webhooks Guide
    • Integration Checklist
  • Check Types
    • AML Screening Check
      • Lists coverage
    • Document Check
      • ID coverage
      • RFID authentication
      • Redaction
      • Expected sides per type
    • Identity Check
    • Enhanced Identity Check
    • Proof of Address Check
    • Multi-Bureau Check
      • Service coverage
    • Face Authentication Check
    • Age Estimation Check
    • Automation
  • Other Services
    • AML Risk Profile
    • Bulk Processing
    • Autofill
    • Company Search
    • Address Search
    • Custom Lists
    • Advanced Case Management
  • Access Management
    • Teams and User Roles
    • Single Sign On (SSO)
      • SSO with Okta
      • SSO with Microsoft Entra ID
  • Useful Resources
    • Testing Data
  • API Reference
Powered by GitBook
On this page
  • Overview of flow
  • Supported SDKs
  • Requirements
  • Getting started
  • 1. Install the SDK
  • 2. Create a client
  • 3. Generate an SDK token
  • 4. Prepare the stages
  • 5. Initialize an SDK flow
  • 6. Perform checks
  • 7. Retrieve results
  • Stages
  • Look and feel
  • Localization
  • Result handling
  • Events tracking
  • Token expiry handling

Was this helpful?

  1. Guides
  2. Mobile SDK Guide

Mobile SDK integration guide

PreviousMobile SDK GuideNextMobile SDK stages

Last updated 7 months ago

Was this helpful?

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

1. Install the SDK

CocoaPods

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

    sudo gem install cocoapods

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

    source 'https://github.com/CocoaPods/Specs.git'
    …
    platform :iOS, ’13.0’
    
    target ‘YourApp’ do
        …
      pod 'ComplyCubeMobileSDK'
    end
    
    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |build_configuration|
                build_configuration.build_settings['ENABLE_BITCODE'] = 'NO'
                build_configuration.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
                build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.1'
                build_configuration.build_settings['ARCHS'] = ['$(ARCHS_STANDARD)', 'x86_64']
                build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = ['arm64', 'arm64e', 'armv7', 'armv7s']
                build_configuration.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
            end
        end
    end

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

<key>NSCameraUsageDescription</key>
<string>Used to capture facials biometrics and documents</string>
  1. NSMicrophoneUsageDescription

<key>NSMicrophoneUsageDescription</key>
<string>Used to capture video biometrics</string>
  1. Our SDK requires the following repositories.

repositories {
  mavenCentral(),
  maven { url 'https://maven.fpregistry.io/releases' }
}

dependencies {
    implementation "com.complycube:complycube-sdk:+"
}
  1. Install the React Native library by running:

npm i -s @complycube/react-native

If you’re integrating Sentry into your React Native project, you might encounter the following compiler error:

'SentryDefines.h' file cannot be found.

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:

  1. In SentrySdkInfo.h and SentryInternalSerializable.h, replace:

    // Replace
    #import "SentryDefines.h"
    
    // With
    #import <Sentry/SentryDefines.h>
  1. Install the ComplyCube Flutter package by running:

    flutter pub add complycube

  2. iOS

    1. Add the snippet below to your ios/PodFile and run the pod install command.

    2. source 'https://github.com/CocoaPods/Specs.git'
      
      platform :iOS, '13.0'
      
      target 'Runner' do
        use_frameworks!
        use_modular_headers!
          ...
          ...
      end
      ...
      post_install do |installer|
       installer.pods_project.targets.each do |target|
         flutter_additional_ios_build_settings(target)
         target.build_configurations.each do |config|
           config.build_settings['ENABLE_BITCODE'] = 'NO'
           config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
           config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
           config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
         end
       end
      end```

  3. Android

  1. Configure your npm registry to use the ComplyCube SDK repository by running the following command in your terminal:

npm config set registry https://complycuberepo.jfrog.io/artifactory/api/npm/cc-react-native-npm-local/
  1. Modify the .npmrc file in your home directory by adding the settings copied from jFrog to the file.

For users of Unix-based systems, the file is located at ~/.npmrc. For Windows users, this file can be found at C:\Users\{username}\.npmrc.

@complycube:registry=https://complycuberepo.jfrog.io/artifactory/api/npm/cc-react-native-npm-local/
//complycuberepo.jfrog.io/artifactory/api/npm/cc-react-native-npm-local/:_password=<PASSWORD>
//complycuberepo.jfrog.io/artifactory/api/npm/cc-react-native-npm-local/:username=<EMAIL>
//complycuberepo.jfrog.io/artifactory/api/npm/cc-react-native-npm-local/:email=<EMAIL>
//complycuberepo.jfrog.io/artifactory/api/npm/cc-react-native-npm-local/:always-auth=true
  1. Install the Cordova library by running:

cordova plugin add @complycube/cordova-plugin

2. Create a client

Example request

curl -X POST https://api.complycube.com/v1/clients \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
          "type": "person",
          "email": "john.doe@example.com",
          "personDetails":{
               "firstName": "John",
               "lastName" :"Doe"
          }
        }'
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const client = await complycube.client.create({
  type: "person",
  email: "john.doe@example.com",
  personDetails: {
    firstName: "John",
    lastName: "Doe"
  }
});
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

new_client = {
    'type':'person',
    'email':'john.doe@example.com',
    'personDetails': {
        'firstName':'John',
        'lastName':'Doe'
    }
}

client = cc_api.clients.create(**new_client)
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$result = $ccapi->clients()->create([
    'type' => 'person',
    'email' => 'john.doe@example.com',
    'personDetails' => [
        'firstName' => 'John',
        'lastName' => 'Doe'
    ]
]);
using ComplyCube.Net;
using ComplyCube.Net.Resources.Clients;

var clientApi = new ClientApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var newClient = new ClientRequest {
  type = "person",
  email = "john.doe@example.com",
  personDetails = new PersonDetails {
    firstName = "John",
    lastName = "Doe"
  }
}

var client = await clientApi.CreateAsync(newClient);

Example response

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

{
  "id": "5eb04fcd0f3e360008035eb1",
  "type": "person",
  "email": "john.doe@example.com",
  "personDetails": {
    "firstName": "John",
    "lastName": "Doe"
  },
  "createdAt": "2023-01-01T17:24:29.146Z",
  "updatedAt": "2023-01-01T17:24:29.146Z"
}

3. Generate an SDK token

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

Example request

curl -X POST https://api.complycube.com/v1/tokens \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
           "clientId":"CLIENT_ID",
           "appId": "com.complycube.SampleApp"
         }'
const { ComplyCube } = require("@complycube/api");
​
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
​
const token = await complycube.token.generate("CLIENT_ID", {
    appId: "com.complycube.SampleApp"
});
from complycube import ComplyCubeClient
​
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
​
token = cc_api.tokens.create('CLIENT_ID', appId='com.complycube.SampleApp')
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$token = $ccapi->tokens()->generate('CLIENT_ID', 'com.complycube.SampleApp');
using ComplyCube.Net;
using ComplyCube.Net.Resources.SDKTokens;

var sdkTokenApi = new SDKTokenApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var sdkTokenRequest = {
  clientId = "CLIENT_ID",
  appId = "com.complycube.SampleApp"
}

var sdkToken = await sdkTokenApi.GenerateToken(sdkTokenRequest);

Example response

{
  "token": "<CLIENT_TOKEN>"
}

4. Prepare the stages

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

let documentStage = DocumentStageBuilder()
  .setAllowedDocumentTypes(types: [
    .passport,
    .nationalIdentityCard(),
  ])
  .useLiveCaptureOnly(enable: false)
  .build()
// Kotlin

val complyCubeBuilder = ComplyCubeSdk.Builder(this, callback =  { }).apply {
    withStages(
        Document(
            identityDocumentType = Passport(), DrivingLicence(),
            useLiveCaptureOnly = false
        ),
        SelfiePhoto()
    )
}
// Java

IdentityDocumentType[] identityDocumentTypes;

identityDocumentTypes = new IdentityDocumentType[1];

identityDocumentTypes[0] = new DrivingLicence();

Document document = new Document(
    // documentType
    null,
    // documentTypes
    identityDocumentTypes,
    // isGuidanceEnabled
    true,
    // useLiveCaptureOnly
    false,
    // isMLAssistanceEnabled
    true,
    // retryLimit
    5,
    // isNFCEnabled
    true
);
const stages = [
  {
    name: "intro",
    heading: "Green Bank ID verification",
  },
  {
    name: "documentCapture",
    showGuidance: false,
    useMLAssistance: true,
    retryLimit: 1,
    documentTypes: {
      passport: true,
      driving_license: ["GB", "FR"],
    },
  },
  "faceCapture",
];
final stages = [
  {
    "name": 'intro',
    "heading": 'Green Bank ID verification',
  },
  {
    "name": 'documentCapture',
    "showGuidance": false,
    "useMLAssistance": true,
    "retryLimit": 1,
    "documentTypes": {
      "passport": true,
      "driving_license": ['GB', 'FR'],
    },
  },
  'faceCapture',
];
const stages = [
  {
    name: "intro",
    heading: "Green Bank ID verification",
  },
  {
    name: "documentCapture",
    showGuidance: false,
    useMLAssistance: true,
    retryLimit: 1,
    documentTypes: {
      passport: true,
      driving_license: ["GB", "FR"],
    },
  },
  "faceCapture",
];

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.

let sdk = ComplyCubeMobileSDK.FlowBuilder()
  .withSDKToken("SDK_TOKEN")
  .withClientId("CLIENT_ID")
  .withStages([documentStage, selfieStage])
  .start(fromVc: self)

var clientAuth = ClientAuth("SDK_TOKEN", "CLIENT_ID")
// Kotlin

val complyCubeBuilder = ComplyCubeSdk.Builder(this, callback =  { }).apply {
    withStages(
        Document(
            identityDocumentType = Passport(), DrivingLicence(),
            useLiveCaptureOnly = false
        ),
        SelfiePhoto()
    )
}.start(
    ClientAuth(
        token = "SDK_TOKEN",
        clientId = "CLIENT_ID"
    )
)
// Java

ComplyCubeSdk.Builder complycubeFlow =
    new ComplyCubeSdk.Builder(this, result - > {});

complycubeFlow.withStages(
    document,
    new SelfiePhoto()
);

complycubeFlow.start(new ClientAuth(
    "SDK_TOKEN",
    "CLIENT_ID"
));
import { ComplyCube } from "@complycube/react-native";
// ...

const settings = {
  clientID: "<CLIENT_ID>",
  clientToken: "<CLIENT_TOKEN>",
  stages: stages,
  // ... other settings
};

return (
  <View style={styles.container}>
    <ComplyCube settings={settings} />
  </View>
);
import 'package:complycube_flutter/ComplyCubeMobileSDK.dart';
// ...

final settings = {
  "clientID": "<CLIENT_ID>",
  "clientToken": "<CLIENT_TOKEN>",
  "stages": stages,
  // ...
}

return MaterialApp(
  home: Scaffold(
    appBar: AppBar(
      title: Text('ComplyCube Integration'),
    ),
    body: ComplyCubeWidget(settings: settings),
  ),
);
var complycube = cordova.require("complycube-sdk-cordova.ComplyCube");
//...

const settings = {
  clientID: "<CLIENT_ID>",
  clientToken: "<CLIENT_TOKEN>",
  stages: stages,
  // ... other settings
};

complycube.start(
    settings,
        (results) => console.log("Success"), 
        (cancel_event) => console.log("Cancel event fired"), 
        (error_event) => console.log("Error event fired"), 
        (custom_event) => console.log("Custom event fired"), 
        (token_event) => console.log("Token expiry event fired")
);

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:

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:

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:

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:

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

curl -X POST https://api.complycube.com/v1/checks \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
            "clientId":"CLIENT_ID",
            "type": "document_check",
            "documentId":"DOCUMENT_ID"
         }'
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const check = await complycube.check.create("CLIENT_ID", {
    type: "document_check",
    documentId: "DOCUMENT_ID"
});
from complycube import ComplyCubeClient

cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

check = cc_api.checks.create(
    "CLIENT_ID", 
    "document_check", 
    documentId="DOCUMENT_ID"
)
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$result = $ccapi->checks()->create('CLIENT_ID', [
    'type' => 'document_check',
    'documentId' => 'DOCUMENT_ID'
]);
using ComplyCube.Net;
using ComplyCube.Net.Resources.Checks;

var checkApi = new CheckApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var checkRequest = new CheckRequest {
  clientId = "CLIENT_ID",
  type = "document_check",
  documentId = "DOCUMENT_ID"
};

var check = await checkApi.CreateAsync(checkRequest);

7. Retrieve results

Example request

curl -X GET https://api.complycube.com/v1/checks/{:checkId} \
     -H 'Authorization: <YOUR_API_KEY>' 
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const check = await complycube.check.get("CHECK_ID");
from complycube import ComplyCubeClient

cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

check = cc_api.checks.get('CHECK_ID')
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$check = $ccapi->checks()->get('CHECK_ID');
using ComplyCube.Net;
using ComplyCube.Net.Resources.Checks;

var checkApi = new CheckApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var check = await checkApi.GetAsync("CHECK_ID");

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.

let sdk = ComplyCubeMobileSDK.FlowBuilder()
  .withSDKToken("SDK_TOKEN")
  .withClientId("CLIENT_ID")
  .withStages([
    WelcomeStageBuilder().build(),
    UserConsentStageBuilder().build(),
    DocumentStageBuilder().build(),
    BiometricStageBuilder().build(),
    AddressCaptureStageBuilder().build(),
    ProofOfAddressBuilder().build(),
  ])
  .withEnableCompleteScreen(...)
  .withLanguage(...)
  .withLookAndFeel(...)
  .withEventHandler(...)
  .withCallbackHandler(...)
  .start(fromVc: self)
// Kotlin

var complycubeFlow = ComplyCubeSdk.Builder(this, callback = ...)
  .withSDKToken("SDK_Token")
  .withClientId("CLIENT_ID")
  .withStages(
    Welcome(...),
    Consent(...),
    Document(...),
    SelfiePhoto(...),
    AddressCapture(...),
    ProofOfAddress(...),
    Complete(...)
  )
  .withLookAndFeel(...)
  .withCustomLanguage(...)

complycubeFlow.start()
// Java

complycubeFlow.withStages(
    new Welcome(...),
    new UserConsent(...),
    new Document(...),
    new SelfiePhoto(...),
    new AddressCapture(...),
    new ProofOfAddress(...),
    new Complete(...)
);

complycubeFlow.withLookAndFeel(...);
complycubeFlow.withCustomLanguage(..);
const stages = [
  {
    name: 'intro',
    // ... other settings
  },
  {
    name: "consent",
    // ... other settings
  },
  {
    name: 'documentCapture',
    // ... other settings
  },
  {
    name: "faceCapture",
    // ... other settings
  },
  {
    name: "poaCapture",
    // ... other settings
  },
  {
    name: "complete",
    // ... other settings
  }
];

const settings = {
  clientID: "CLIENT_ID",
  clientToken: "SDK_TOKEN",
  stages: stages,
  language: "en",
  lookAndFeel: {/*...*/}
}

<ComplyCube
  settings={settings} 
  onSuccess={/*...*/} 
  onCancel={/*...*/}
  onError={/*...*/}
  onEventCallback={/*...*/}
/>
final stages = [
  {
    name: 'intro',
    // ... other settings
  },
  {
    name: "consent",
    // ... other settings
  },
  {
    name: 'documentCapture',
    // ... other settings
  },
  {
    name: "faceCapture",
    // ... other settings
  },
  {
    name: "poaCapture",
    // ... other settings
  },
  {
    name: "complete",
    // ... other settings
  }
];

final settings = {
  "clientID": "<CLIENT_ID>",
  "clientToken": "<CLIENT_TOKEN>",
  "stages": stages,
  "language": "en",
  "lookAndFeel": {/*...*/}
}

return MaterialApp(
  home: Scaffold(
    appBar: AppBar(
      title: Text('ComplyCube Integration'),
    ),
    body: ComplyCubeWidget(settings: settings),
  ),
);
const stages = [
  {
    name: 'intro',
    // ... other settings
  },
  {
    name: "consent",
    // ... other settings
  },
  {
    name: 'documentCapture',
    // ... other settings
  },
  {
    name: "faceCapture",
    // ... other settings
  },
  {
    name: "poaCapture",
    // ... other settings
  },
  {
    name: "complete",
    // ... other settings
  }
];

const settings = {
  clientID: "CLIENT_ID",
  clientToken: "SDK_TOKEN",
  stages: stages,
  language: "en",
  lookAndFeel: {/*...*/}
}

complycube.start(settings);

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.

Creating a custom appearance

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

let ccLookAndFeel = LookAndFeel()
ccLookAndFeel.primaryButtonBgColor = .green
ccLookAndFeel.uiInterfaceStyle = .dark //can also be .light or .inherited

Applying your custom appearance

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

let sdk = ComplyCubeMobileSDK.FlowBuilder()
  .withLookAndFeel(ccLookAndFeel)
  .start(fromVc: self)
// Kotlin

complycubeFlow.withLookAndFeel(
    lookAndFeel = LookAndFeel(
        primaryButtonBgColor = Color.RED,
        /* Can also be set to UIInterfaceStyle.LIGHT 
        or UIInterfaceStyle.INHERITED */
        uiInterfaceStyle = UIInterfaceStyle.DARK
    )
)
// Java

complycubeFlow.withLookAndFeel(new LookAndFeel(
    // primaryButtonBGColor
    Color.parseColor("#FF0000"),
    // uiInterfaceStyle
    UIInterfaceStyle.DARK,
    ...
));
const settings = {
  // ...
  lookAndFeel: {
    // Primary action button background color
    primaryButtonBgColor: "#FFFFFF",

    // Force SDK to 'dark', 'light', or 'inherit' mode
    uiInterfaceStyle: "dark",
  },
};
final settings = {
  // ...
  "lookAndFeel": {
    // Primary action button background color
    "primaryButtonBgColor": '#FFFFFF',
    
    // Force SDK to 'dark', 'light', or 'inherit' mode
    "uiInterfaceStyle": "dark"
  }
}

To disable the header display in the ComplyCube SDK Widget on Android, please insert the following line into styles.xml:

<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
  ...
  <item name="windowActionBar">false</item>
  <item name="windowNoTitle">true</item>
  ...
</style>
...
const settings = {
  // ...
  lookAndFeel: {
    // Primary action button background color
    primaryButtonBgColor: "#FFFFFF",

    // Force SDK to 'dark', 'light', or 'inherit' mode
    uiInterfaceStyle: "dark",
  },
};

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.

extension ViewController: ComplyCubeMobileSDKDelegate {
  func onSuccess(_ result: ComplyCubeResult) {
   /*
    Handling successful results:
    Our default flow includes three components: an Identity Document,
    a Selfie (Live Photo), and a Proof of Address. Upon successful 
    completion, the 'result' parameter will contain `documentIds`and `livePhotoId`
    */
    print("The flow has completed - here are the ID's returned")
  }
  
  func onError(_ error: ComplyCubeError) {
    // Handle errors
    print("An error has occurred")
  }

  func onCancelled(_ error: ComplyCubeError) {
    // Handle cancellations
    print("The user has cancelled the flow or not accepted the terms")
  }  
}
//Kotlin

//Register a result handler to process the outcome of the flow.
var complycubeFlow =
    ComplyCubeSdk.Builder(
        this,
        callback = { result ->
            when (result) {
                is Result.Success -> { 
                /*
                Handling successful results:
                Our default flow includes three components: an Identity Document,
                a Selfie (Live Photo), and a Proof of Address. Upon successful 
                completion, the 'Result' will contain an array of stage results.
                Each stage result provides the ID of the uploaded item:
                  - 'StageResult.Document.Id': the uploaded Document ID.
                  - 'StageResult.LivePhoto.Id': the uploaded Live Photo ID.
                  - 'StageResult.ProofOfAddress.Id': the uploaded PA Document ID.
                */
                }
                is Result.Cancelled -> { /* Handle Cancelled result */ }
                is Result.Error -> {
                    // Handle errors
                    when (result.errorCode) {
                        ComplyCubeErrorCode.UploadError -> {
                            // Handle Upload error
                        }
                        ComplyCubeErrorCode.BiometricStageCount -> {
                            // Handle BiometricStageCount error
                        }
                        // ...other error handlers
                    }
                }
                else -> {}
            }
        }
    )

complycubeFlow.start(clientAuth)
// Java

//Register a result handler to process the outcome of the flow.
ComplyCubeSdk.Builder complycubeFlow = new ComplyCubeSdk.Builder(this, result - > {
    if (result instanceof Result.Success) {
        /*
        Handling successful results:
        Our default flow includes three components: an Identity Document,
        a Selfie (Live Photo), and a Proof of Address. Upon successful 
        completion, the 'Result' will contain an array of stage results.
        Each stage result provides the ID of the uploaded item:
          - 'StageResult.Document.Id': the uploaded Document ID.
          - 'StageResult.LivePhoto.Id': the uploaded Live Photo ID.
          - 'StageResult.ProofOfAddress.Id': the uploaded PA Document ID.
        */
    } else if (result instanceof Result.Error) {
        switch (((Result.Error) result).getErrorCode()) {
            case ComplyCubeErrorCode.UploadError.INSTANCE:
                // Handle upload error
                break;
            case ComplyCubeErrorCode.BiometricStageCount.INSTANCE:
                // Handle BiometricStageCountError
                break;
                // ... other error handlers
            default:
        }
    } else if (result instanceof Result.Canceled) {
        // Handle Cancelled result
    }
    return null;
});
function onSuccess(results){
  /*
    Handling successful results:
    Our default flow includes three components: an Identity Document,
    a Selfie (Live Photo), and a Proof of Address. Upon successful 
    completion, the 'results' parameter will contain: 
      - "documentIds": ["xxxxx"]
      - "livePhotoIds": ["xxxxx"]
      - "poaIds": ["xxxxxx"]
  */
  console.log(results);
}

function onCancelled(){
  console.log("The user cancelled");
}

function onError(error){
  console.log(error);
}

return(<View>
    <ComplyCube 
      settings={settings}
      onSuccess={onSuccess}
      onCancel={onCancelled}
      onError={onError}
       />
  </View>
)
void onSuccess(Map<String, dynamic> results) {
 /*
    Handling successful results:
    Our default flow includes three components: an Identity Document,
    a Selfie (Live Photo), and a Proof of Address. Upon successful 
    completion, the 'results' parameter will contain: 
      - "documentIds": ["xxxxx"]
      - "livePhotoIds": ["xxxxx"]
      - "poaIds": ["xxxxxx"]
  */
}

void onCancelled() {
  // Handle cancellations
}

void onError(ComplyCubeError error) {
  // Handle errors
}

ComplyCubeWidget(
  settings: settings,
  onSuccess: onSuccess,
  onCancelled: onCancelled,
  onError: onError,
)
function onSuccess(results){
  /*
    Handling successful results:
    Our default flow includes three components: an Identity Document,
    a Selfie (Live Photo), and a Proof of Address. Upon successful 
    completion, the 'results' parameter will contain: 
      - "documentIds": ["xxxxx"]
      - "livePhotoIds": ["xxxxx"]
      - "poaIds": ["xxxxxx"]
  */
  console.log(results);
}

function onCancelled(){
  console.log("The user cancelled");
}

function onError(error){
  console.log(error);
}

complycube.start(
    settings,
        (results) => console.log("Success"), 
        (cancel_event) => console.log("Cancel event fired"), 
        (error_event) => console.log("Error event fired"), 
        (custom_event) => console.log("Custom event fired"), 
        (token_event) => console.log("Token expiry event fired")
);

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

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

let sdk = ComplyCubeMobileSDK.FlowBuilder()
  .withEventHandler({ (event: Event) -> Void in
    // Insert custom user tracking code here
  })

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

// Kotlin

complycubeBuilder.withEventHandler(true) { event ->
    // Insert custom user tracking here
}
// Java

complycubeFlow.withEventHandler(true, analyticsEvent - >
    // Insert custom user tracking here
);

To incorporate your own tracking, define a function and apply it using the eventHandler property in your settings:

function myCustomEventHandler(event){
  // Insert custom user tracking code here
  console.log(event.code);
  console.log(event.message);
}

const settings = {
  eventHandler: {myCustomEventHandler}
  // ... other settings
}

To incorporate your own tracking, define a function and apply it using the onCustomEvent property when initializing the Flutter widget:

void onCustomEvent(ComplyCubeCustomEvent event){
  switch(event.name){
    case 'BIOMETRICS_STAGE_SELFIE_CAMERA':
      print("The client reached capture camera for a selfie")
      break;
  }
}

ComplyCubeWidget(
  settings: settings,
  onCustomEvent: onCustomEvent,
  // ...
),

To incorporate your own tracking, define a function and apply it using the eventHandler property in your settings:

function myCustomEventHandler(event){
  // Insert custom user tracking code here
  console.log(event.code);
  console.log(event.message);
}

complycube.start(
    settings,
        (results) => console.log("Success"), 
        (cancel_event) => console.log("Cancel event fired"), 
        (error_event) => console.log("Error event fired"), 
        myCustomEventHandler, 
        (token_event) => console.log("Token expiry event fired")
);

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.

let sdk = ComplyCubeMobileSDK.FlowBuilder()
  .withTokenExpiryHandler({ () -> String in
    // Insert custom token renewal code here
  })
// Kotlin

var complyCubeBuilder = ComplyCubeSdk.Builder(this,
    callback = { result ->
        if (result is Result.Error) {
            if (result.errorCode is ComplyCubeErrorCode.ExpiredToken) {
                // Insert custom token renewal code here
            }
        }
    }
)
// Java

ComplyCubeSdk.Builder complyCubeBuilder =
    new ComplyCubeSdk.Builder(this, result - > {
        if (result instanceof Result.Error) {
            if (((Result.Error) result).getErrorCode() == ComplyCubeErrorCode.ExpiredToken.INSTANCE) {
                // Insert custom token renewal code here
            }
        }
        return null;
    });
function myCustomExpiryHandler(){
  // Insert custom token renewal code here
}

const settings = {
  tokenExpiryHandler: {myCustomExpiryHandler}
  // ... other settings
}
String onTokenExpiry(String token){
  // Insert custom token renewal code here
}

ComplyCubeWidget(
  settings: settings,
  onTokenExpiry: onTokenExpiry,
  // ...
),
function myCustomExpiryHandler(){
  // Insert custom token renewal code here
}

complycube.start(
    settings,
        (results) => console.log("Success"), 
        (cancel_event) => console.log("Cancel event fired"), 
        (error_event) => console.log("Error event fired"), 
        (custom_event) => console.log("Custom event fired"),
        myCustomExpiryHandler
);

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

Complete the steps in the and tabs.

Sentry Integration

Complete the steps 1 and 2 in the tabs.

Complete Application permissions steps in the tabs.

Complete the steps in the tab.

Complete the steps in the and tabs.

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

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

SDK Tokens enable clients to send personal data securely from your mobile app to ComplyCube. .

result.documentId to run a .

result.documentId and result.livePhotoId to run an .

StageResult.Document.Id to run a .

StageResult.Document.Id and StageResult.LivePhoto.Id to run an .

result.documentId to run a .

result.documentId and result.livePhotoId to run an .

result.documentId to run a .

result.documentId and result.livePhotoId to run an .

result.documentId to run a .

result.documentId and result.livePhotoId to run an .

Your can retrieve all check results using our API.

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

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

Learn more about our .

Upon an "on success" callback, you can initiate directly from your 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 .

The SDK tracks an array of 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 .

⚠️
user guide
API reference
create a client
Learn more about our SDK Token endpoint
Document Check
Identity Check
Document Check
Identity Check
Document Check
Identity Check
Document Check
Identity Check
Document Check
Identity Check
set up webhooks
webhooks guide
check request
Learn more about our Mobile SDK stages.
Mobile SDK error codes
events
tracked events
iOS
Android
iOS
iOS
Android
iOS
Android
mobile app backend
mobile backend
appearance properties
check requests
mobile app backend
Mobile SDK integration flow
Cover

iOS

Cover

Android

Cover

React Native (BETA)

Cover

Flutter (BETA)

Cover

Cordova (BETA)