Check-Driven Integration
Integrate the Android SDK using a check-driven approach.
Overview
This guide walks you through integrating the Android SDK with ComplyCube using the check-driven approach, giving you direct control over individual verification steps.

You’re viewing the check-driven SDK guide - an approach that provides detailed control but is best suited for partners or advanced use cases. We recommend using workflow integration for most implementations.
Integration flow
The Mobile SDK runs on your mobile application, but relies on your backend to create secure tokens. Here’s how it works:

Integration guide
Explore the source code and sample projects on our repository: .
Create a client
Every verification flow starts with a client (i.e. customer). Use the API to create the client.
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). It is required for the next step.
Generate an SDK token
Your backend must create an SDK token for each new flow. This token enable customers to send personal data securely from your mobile app to ComplyCube.
Tokens are short-lived and must not be reused.
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');Example response
{
"token": "<CLIENT_TOKEN>"
}Perform checks
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.
Example request for a Document Check
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.
Retrieve verification 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 customers.
The snippet below demonstrates how to set up a customized flow using the ComplyCube Mobile SDK.
Welcome
The Welcome screen is always shown first in the verification flow. It displays a welcome message along with a summary of the configured stages the user will complete.
You can customize the screen title to align with your app’s tone and branding.
Consent
This stage is used to collect explicit user consent before proceeding with the verification flow. It helps you meet regulatory and compliance requirements where applicable.
You can customize the screen title and message to match your legal or branding needs.
Selfie photo and video
You can request either a selfie photo (i.e. a Live Photo) or a selfie video (i.e. a Live Video) from the customer as part of the biometric verification process.
Photo: Captures a still image and performs a passive liveness check before allowing submission.
Video: Records a short video where the user completes an on-screen challenge (e.g. head movement or spoken phrase).
If you attempt to add both types of stages, the SDK will throw a ComplyCubeErrorCode.BiometricStageCount error stating multiple conflicting stages.
Document
The Document stage allows users to select and capture an identity document for verification (e.g. passport, ID card, residence permit). You can customize these screens to:
Limit the scope of document types the client can select, e.g., Passport only.
Set the document issuing countries they are allowed for each document type.
Add or remove automated capture using smart assistance.
Show or hide the instruction screens before capture.
Set a retry limit to allow clients to progress the journey regardless of capture quality.
You can control whether instructional screens are shown before each camera capture by enabling or disabling guidance mode. Only disable guidance if your users are already clearly informed about the capture steps, as these screens help reduce user error and improve capture quality.
NFC capture
The ComplyCube mobile SDK supports NFC-based RFID chip reading for identity documents equipped with embedded chips. This allows for secure data extraction and high-assurance document authentication.
Pre-requisites
Start by adding your access credentials for the ComplyCube NFC-Enabled SDK repository to the
gradle.propertiesfile of your mobile app:
Then, update your project level
build.gradlefile with the ComplyCube SDK repository Maven settings:
Update your module level
build.gradlefile with the SDK dependency:
Enabling NFC capture
Address capture
This stage allows users to manually enter their residential address. You can customize it to:
Restrict input to specific countries
Enable or disable the address autocomplete feature for faster and more accurate entry
Proof of address
This stage allows customers to submit a document verifying their residential address. You can configure which document types are accepted, such as utility bills or bank statements, and choose whether customers can upload a file or must capture the document live using their device camera.
Completion
You can include a completion stage at the end of the flow to confirm that the process has been successfully finished. This screen provides a clear end point for the user and can be customized to display a confirmation message or next steps.
Branding
The SDK allows you to customize the UI to match your application’s visual identity. You can define primary and accent colors during configuration to align the verification flow with your brand guidelines. Learn more about our appearance properties (see below).
Localization
The SDK supports the languages listed below.
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 manage the outcome of a verification session, you must implement the success, cancelled, and error callbacks.
On a successful completion (onSuccess), you can trigger check requests from your backend using the resource IDs returned in the result object. These IDs correspond to the uploaded assets (e.g. documents, selfies) and can be used to initiate verification checks via the ComplyCube API.
If the user exits the flow before completion, the onCancelled callback is invoked with a descriptive reason indicating why the session was cancelled (e.g. user exit, timeout, permission denied)
If the SDK encounters an issue, the onError callback is triggered with a ComplyCubeError object containing the error type and message. Refer to the error codes (see below), for a full list of possible error cases.
Events tracking
The SDK tracks a range of events throughout the verification flow, covering all key user interactions across stages. See below for the list of events.
If you need to implement custom analytics, you can hook into these events and trigger your own tracking logic accordingly.
To incorporate your own tracking, define a function and apply it using withEventHandler when initializing the Builder:
Token expiry handling
To handle token expiration gracefully, you can provide a callback function that generates a new SDK token when needed. This allows the flow to continue seamlessly without requiring the user to restart the session manually.

