Flutter
Guide for integrating Cactusverify SDK into a Flutter project
Last updated
Was this helpful?
Guide for integrating Cactusverify SDK into a Flutter project
Last updated
Was this helpful?
Before integrating Cactusverify, it is recommended to follow the steps described in and .
Naming of the properties and functions might be slightly modified depending on the version.
Cactusverify SDK should be integrated into the existing Flutter project (more information regarding creating Flutter projects is here: )
At the root level of your project, find the pubspec.yaml file and add the following line in the dependencies section:
If there is no Podfile in ios
folder, run flutter build ios
in the terminal of the project folder.
Add sources to Podfile and use minimum iOS version 11.0.
Then navigate to ios
folder and run pod install
.
pod install might take long time!
Please add the following permissions to your app's Info.plist
, so that the Cactusverify iOS SDK can access a user's camera to run a verification. You can do this in the property list view or by code. Right-click on Info.plist
and select Open As
-> Source Code
. Add the lines below somewhere inside the following code:
Open android/app/build.gradle
file and set minSdkVersion
to 21.
To initialize Cactusverify SDK, it first should be imported:
After this, it is needed to initialize SDK with your appId:
Call sdk.startSession()
on button click:
It's useful to know that if a user has completed the verification flow or canceled it. For this, you can implement the callback methods:
Method
Description
onInitialize
This callback method is triggered when SDK initializes
onStart
This callback method is triggered when user starts verification
onFinish
This callback method is triggered when user completes verification. Get session data here
onError
Error Code
Description
INVALID_APP_ID
Kvalifika AppId (Application ID) is incorrect
USER_CANCELLED
User cancelled the session before completing verification
TIMEOUT
Session is cancelled due to inactivity
SESSION_UNSUCCESSFUL
The Session was not performed successfully
ID_UNSUCCESSFUL
The ID Scan was not performed successfully and identity document data was not generated
CAMERA_PERMISSION_DENIED
Camera is required but access is prevented by user settings
LANDSCAPE_MODE_NOT_ALLOWED
Verification session is cancelled because the device is in landscape mode
REVERSE_PORTRAIT_NOT_ALLOWED
Verification session is cancelled because device is in reverse portrait mode
FACE_IMAGES_UPLOAD_FAILED
Could not upload face images. Internal request failed.
DOCUMENT_IMAGES_UPLOAD_FAILED
Could not upload ID card or passport images. Internal request failed.
UNKNOWN_INTERNAL_ERROR
Verification session failed because of an unhandled internal error. This error comes with a message.
It is possible to customize logo and icons for the application.
In Flutter we need to add the images in android
and ios
subfolders in the project directory.
An image name in android
and ios
subfolders must match.
It is possible to set locale when initializing SDK. Supported locales are:
Code
Language
EN
English
GE
Georgian
If ProGuard is used in Android release build, it is possible to add the following options to ProGuard file:
appId is Application ID, generated from Admin Panel. See for details.
This callback method is triggered on error (see for more information)
Without specifying mode SDK uses
With development mode ON SDK uses