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:
sudogeminstallcocoapods
Add plugin repos and install the pod using your Podfile:
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.
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',];
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.
conststages= [ { name:'intro',// ... other settings }, { name:"consent",// ... other settings }, { name:'documentCapture',// ... other settings }, { name:"faceCapture",// ... other settings }, { name:"poaCapture",// ... other settings }, { name:"complete",// ... other settings }];constsettings= { clientID:"CLIENT_ID", clientToken:"SDK_TOKEN", stages: stages, language:"en", lookAndFeel: {/*...*/}}<ComplyCubesettings={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": {/*...*/}}returnMaterialApp( home:Scaffold( appBar:AppBar( title:Text('ComplyCube Integration'), ), body:ComplyCubeWidget(settings: settings), ),);
conststages= [ { name:'intro',// ... other settings }, { name:"consent",// ... other settings }, { name:'documentCapture',// ... other settings }, { name:"faceCapture",// ... other settings }, { name:"poaCapture",// ... other settings }, { name:"complete",// ... other settings }];constsettings= { 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.
Before initiating the flow, create your own custom design and integrate it into your Flow Builder.
let ccLookAndFeel =LookAndFeel()ccLookAndFeel.primaryButtonBgColor = .greenccLookAndFeel.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)
// KotlincomplycubeFlow.withLookAndFeel( lookAndFeel =LookAndFeel( primaryButtonBgColor = Color.RED,/* Can also be set to UIInterfaceStyle.LIGHT or UIInterfaceStyle.INHERITED */ uiInterfaceStyle = UIInterfaceStyle.DARK ))
constsettings= {// ... 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:
constsettings= {// ... 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.
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.
extensionViewController:ComplyCubeMobileSDKDelegate {funconSuccess(_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") }funconError(_error: ComplyCubeError) {// Handle errorsprint("An error has occurred") }funconCancelled(_error: ComplyCubeError) {// Handle cancellationsprint("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 errorswhen (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 instanceofResult.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. */ } elseif (result instanceofResult.Error) {switch (((Result.Error) result).getErrorCode()) {caseComplyCubeErrorCode.UploadError.INSTANCE:// Handle upload errorbreak;caseComplyCubeErrorCode.BiometricStageCount.INSTANCE:// Handle BiometricStageCountErrorbreak;// ... other error handlersdefault: } } elseif (result instanceofResult.Canceled) {// Handle Cancelled result }returnnull;});
functiononSuccess(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);}functiononCancelled(){console.log("The user cancelled");}functiononError(error){console.log(error);}return(<View> <ComplyCubesettings={settings}onSuccess={onSuccess}onCancel={onCancelled}onError={onError} /> </View>)
voidonSuccess(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"] */}voidonCancelled() {// Handle cancellations}voidonError(ComplyCubeError error) {// Handle errors}ComplyCubeWidget( settings: settings, onSuccess: onSuccess, onCancelled: onCancelled, onError: onError,)
functiononSuccess(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);}functiononCancelled(){console.log("The user cancelled");}functiononError(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 SDK experiences any issues, the "onerror" 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:
let sdk = ComplyCubeMobileSDK.FlowBuilder() .withEventHandler({ (event: Event) ->Voidin// Insert custom user tracking code here })
To incorporate your own tracking, define a function and apply it using withEventHandler when initializing the Builder:
// KotlincomplycubeBuilder.withEventHandler(true) { event ->// Insert custom user tracking here}
// JavacomplycubeFlow.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:
functionmyCustomEventHandler(event){// Insert custom user tracking code hereconsole.log(event.code);console.log(event.message);}constsettings= { eventHandler: {myCustomEventHandler}// ... other settings}
To incorporate your own tracking, define a function and apply it using the onCustomEvent property when initializing the Flutter widget:
voidonCustomEvent(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:
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({ () ->Stringin// Insert custom token renewal code here })
// Kotlinvar complyCubeBuilder = ComplyCubeSdk.Builder(this, callback = { result ->if (result is Result.Error) {if (result.errorCode is ComplyCubeErrorCode.ExpiredToken) {// Insert custom token renewal code here } } })