Workflow Integration
Integrate KYC workflows in Flutter apps using the ComplyCube SDK.
Overview
This guide walks you through integrating the Flutter SDK with ComplyCube workflows.

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
Install the SDK
Install the ComplyCube Flutter package by running:
iOS
Complete the steps 1 and 2 in the iOS tabs.
Add the snippet below to your
ios/PodFileand run thepod installcommand.Complete Application permissions steps in the iOS tabs.
Android
Complete the steps in the Android tab.
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
No action required.
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.
Initialize the SDK
As part of initializing the SDK, you are required to specify a workflow template ID. The SDK will automatically run the active version of the selected workflow.
Perform verification
Once your customer starts the flow, a workflow session is automatically created. This session contains all captured data (documents, images, and videos) as well as progress tracking. You can view all of them through the workflow sessions page on the portal or through the API.
When the flow finishes, the SDK triggers the onSuccess callback. The callback provides a data object that includes the workflowSessionId. Your mobile backend should use this ID to notify ComplyCube that the workflow has completed, which in turn runs the verification checks defined in the workflow.
If you have set up webhooks as described in our webhooks guide, you will be notified once a workflow session completes.
Example of a complete workflow session request
Retrieve verification results
Your mobile backend can retrieve the workflow session details and associated 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.
You can retrieve the details of a workflow session by calling the retrieve workflow session request.
To retrieve the check results, you can perform a get check request.
Example of a workflow session retrieval request
Example of a check retrieval request
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
Install the CocoaPods Artifactory plugin by running the following command in your terminal:
To add the library, copy your repository credentials into a
.netrcfile to your home directory and setup the repository:Remember to fetch your credentials from JFrog using the Set Me Up button here.
Add plugin repos and install the pod using your
Podfile:You must add the following keys to your application
Info.plistfile:To read NFC tags correctly, you need to add the following entries to your app target's
Info.plistfile:Add the following in your
Runner.entitlementsfile:To enable NFC when building your iOS app, pass the
USE_CCNFCenvironment variable during the build:To keep this enabled for all iOS builds, add the following line near the top of your
ios/Podfile:
Start by adding your access credentials for the ComplyCube NFC-Enabled SDK repository to the
gradle.propertiesfile of your mobile app:
Replace <YOUR_USERNAME> and <YOUR_PASSWORD> with your ComplyCube Artifactory credentials. If you don’t have access, contact ComplyCube Support to request credentials.
Then, update your project level
build.gradleorbuild.gradle.ktsfile with the ComplyCube SDK repository Maven settings:
Branding
You can customise colours, logos, and other branding elements through the branding settings page, if available on your plan.
Localization
The SDK supports several languages, including those 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🇻🇳and more...
Result handling
To run a verification session, you must implement the success, cancelled, and error callbacks.
On a successful completion (onSuccess), you can trigger a workflow session complete requests from your backend using the workflow session ID returned in the result object.
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 the onCustomEvent property when initializing the Flutter widget:
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.

