Integrate IDmission's IDentity SDK into your Android Flutter application.
sourceCompatibility JavaVersion.VERSION_17; use JDK 17 or newerflutter create generates compileSdk = flutter.compileSdkVersion, minSdk = flutter.minSdkVersion, and targetSdk = flutter.targetSdkVersion. Replace all three with the hardcoded values shown in Step 2 — the plugin requires exact versions.Add the plugin as a git dependency in your app's pubspec.yaml, then fetch it.
dependencies:
flutter:
sdk: flutter
flutter_plugin_identity_sdk:
git:
url: https://github.com/Idmission-LLC/SDK2Flutter.git
ref: v11.1.19
path: flutter_plugin_identity_sdk
flutter pub get
Configure SDK versions, Java compatibility, and multidex in your app-level build file.
android {
compileSdkVersion 36
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
defaultConfig {
minSdkVersion 26
targetSdkVersion 36
multiDexEnabled true
}
}
android {
compileSdk = 36
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
minSdk = 26
targetSdk = 36
multiDexEnabled = true
}
}
Add the IDmission Maven repository to your project-level build file.
allprojects { repositories { } }. Do not use dependencyResolutionManagement.repositories — Flutter's Gradle plugin uses includeBuild, which is incompatible with it.allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://gitlab.idmission.com/api/v4/projects/220/packages/maven"
name "GitLab"
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = "WESesyuSD9fQeqNEyig6"
}
authentication {
header(HttpHeaderAuthentication)
}
}
maven { url 'https://jitpack.io' }
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://gitlab.idmission.com/api/v4/projects/220/packages/maven")
name = "GitLab"
credentials(HttpHeaderCredentials::class) {
name = "Private-Token"
value = "WESesyuSD9fQeqNEyig6"
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
maven { url = uri("https://jitpack.io") }
}
}
Connect a physical Android device and run the application.
flutter run
Import the package and follow this pattern for every service call:
import 'package:flutter_plugin_identity_sdk/flutter_plugin_identity_sdk.dart';
// 1. Initialise once before calling any service
await FlutterPluginIdentitySdk.idm_sdk_init(apiBaseUrl, 'n', accessToken);
// 2. Call a service
final result = await FlutterPluginIdentitySdk.idm_sdk_serviceID10('y', 12345);
// 3. Submit the result
await FlutterPluginIdentitySdk.submit_result();
Initializes the SDK. Must be called before any other function. Returns “SDK Successfully Initialized” on success (the same text on iOS and Android), or “Error” / an error message on failure.
await FlutterPluginIdentitySdk.idm_sdk_init(
String apiBaseUrl, // API base URL — provided by IDmission
String debug, // 'y' turns on verbose SDK logging; use 'n' in production
String accessToken, // your IDmission access token
// Optional named parameters — these are the defaults:
String language = 'en', // 'en' or 'es' (Android also 'my' and 'ar')
bool enableGPS = true, // capture GPS location with submissions
bool geolocationRequired = false, // block the flow if location access is denied
bool isUpdateModelsData = true, // download the latest SDK models after credential verification
bool enableScreenRecording = false, // allow screen recording / screenshots during capture
);
Returns the SDK version and the names of the models in use. models is empty until the SDK has been initialized.
final info = await FlutterPluginIdentitySdk.getSDKInfo();
// info['version'] : SDK version
// info['models'] : [{'name': ..., 'value': ...}, ...]
Initiates the ID Validation (Service ID 20) flow. Captures and validates a government-issued ID document.
await FlutterPluginIdentitySdk.idm_sdk_serviceID20(
String captureBack, // 'y' captures front and back, 'n' front only
int clientTraceId, // your unique integer trace ID for this transaction
);
await FlutterPluginIdentitySdk.submit_result();
Initiates the ID Validation and Face Match (Service ID 10) flow. Captures an ID document and performs a liveness face match against the photo on the ID.
await FlutterPluginIdentitySdk.idm_sdk_serviceID10(
String captureBack, // 'y' captures front and back, 'n' front only
int clientTraceId, // your unique integer trace ID for this transaction
);
await FlutterPluginIdentitySdk.submit_result();
Initiates the Identify Customer (Service ID 185) flow. Identifies an unknown individual against enrolled customer profiles.
await FlutterPluginIdentitySdk.idm_sdk_serviceID185();
await FlutterPluginIdentitySdk.submit_result();
Initiates the Live Face Check (Service ID 660) flow. Performs liveness detection without document capture.
await FlutterPluginIdentitySdk.idm_sdk_serviceID660();
await FlutterPluginIdentitySdk.submit_result();
Initiates the ID Validation and Customer Enrollment (Service ID 50) flow. Validates an ID document and enrolls the customer biometric profile.
await FlutterPluginIdentitySdk.idm_sdk_serviceID50(int uniqueCustomerNumber);
await FlutterPluginIdentitySdk.submit_result();
Initiates the Customer Biometric Enrollment (Service ID 175) flow. Enrolls or updates a customer's biometric profile without document capture.
await FlutterPluginIdentitySdk.idm_sdk_serviceID175(int uniqueCustomerNumber);
await FlutterPluginIdentitySdk.submit_result();
Initiates the Customer Verification (Service ID 105) flow. Verifies a returning customer against their enrolled biometric profile.
await FlutterPluginIdentitySdk.idm_sdk_serviceID105(int uniqueCustomerNumber);
await FlutterPluginIdentitySdk.submit_result();
Submits the captured data and finalizes the current service flow. Call after every service.
await FlutterPluginIdentitySdk.submit_result();
If your app was set up from FlutterSDK2AndroidResources.zip, switch to the GitHub package. It replaces the files you copied from the zip.
Delete your local copy of the plugin, usually the flutter_plugin_identity_sdk folder. In pubspec.yaml, replace its path: entry with the git entry from Step 1. Then run flutter clean and flutter pub get.
If you copied CallPluginActivity.java or FlutterPluginIdentitySdkPlugin.java into your app, delete them. Also remove these from your app if you added them: the CallPluginActivity entry in AndroidManifest.xml and the idmission-mediumsdk dependency line in app/build.gradle. The plugin now adds all of these itself.
Keep the IDmission Maven repository (Step 3). It has not changed.
Your existing Dart code keeps working. Run your app on a device and test one service.