idmeta_flutter 2.4.0
idmeta_flutter: ^2.4.0 copied to clipboard
Flutter plugin for IDmeta identity verification on Android and iOS. Integrate trust flows for document, biometric, and compliance checks in mobile apps using your IDmeta account.
IDmeta Flutter Plugin #
Flutter plugin for integrating IDmeta identity verification into your Flutter application.
Requirements #
- Flutter
>=3.44.1 - Dart
>=3.12.1 <4.0.0(bundled with Flutter 3.44.1+)
Android #
Use your app’s normal Flutter Android setup: compileSdk = flutter.compileSdkVersion, minSdk / targetSdk from flutter.*, and an Android Gradle Plugin (AGP) version that matches Flutter’s Android build requirements and the AGP ↔ Gradle compatibility table.
This plugin is built against Android compileSdk 37. If your Flutter toolchain still reports flutter.compileSdkVersion below 37, set compileSdk to at least 37 until you upgrade Flutter—for example compileSdk = Math.max(flutter.compileSdkVersion as int, 37) in Groovy, or compileSdk = maxOf(flutter.compileSdkVersion, 37) in Kotlin DSL. The host app must use minSdk ≥ 24 (for example minSdk = Math.max(flutter.minSdkVersion as int, 24) when Flutter’s default is lower).
If your Trust Flow includes Location Intelligence or ML Score, add ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION to your app’s AndroidManifest.xml; without them Android denies location without showing a prompt.
Smaller Android apps (optional) #
Two settings let Google Play services provide the selfie face model and the
PhilSys QR model instead of bundling them in your app. Add either line to your
app's android/gradle.properties:
# Selfie face detection: about 12 MB smaller
idmeta.faceDetection.usePlayServices=true
# PhilSys QR scanning: about 6 MB smaller
dev.steenbakker.mobile_scanner.useUnbundled=true
Use them only if every phone your app runs on has Google Play services. On
phones without it, such as newer Huawei phones and many kiosk tablets, the
selfie or QR step can't work. The model downloads the first time the step
runs; to download it when the app is installed instead, add this inside
<application> in your AndroidManifest.xml (list only the ones you turned
on):
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="face,barcode" />
iOS #
- iOS builds use Swift Package Manager for several plugin dependencies (including the V2 document reader).
- Minimum deployment target: iOS 16.0
- Add camera, photo library, and location usage descriptions to your app’s
Info.plist(seeexample/ios/Runner/Info.plistfor reference) - If your iOS app uses CocoaPods instead of Swift Package Manager, enable the
permissions in your
Podfile'sGCC_PREPROCESSOR_DEFINITIONS:PERMISSION_CAMERA=1, plusPERMISSION_LOCATION_WHENINUSE=1if your Trust Flow includes Location Intelligence or ML Score. Without them, iOS denies the permission without showing a prompt.
Installation #
Install the plugin from pub.dev:
flutter pub add idmeta_flutter
Or add manually to pubspec.yaml:
dependencies:
idmeta_flutter: ^2.4.0
Then run:
flutter pub get
Import #
import 'package:idmeta_flutter/idmeta_flutter.dart';
Quick Start #
Call IdmetaFlutter.startVerification to launch the identity verification flow. The runnable app under example/ provides a form where you can enter the user token, trust flow ID, and client ID before starting verification.
import 'package:flutter/material.dart';
import 'package:idmeta_flutter/idmeta_flutter.dart';
void main() {
runApp(const MyApp());
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('IDmeta Plugin Example'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
IdmetaFlutter.startVerification(
context: context,
userToken: '<USER_API_TOKEN>',
trustFlowId: 123,
clientId: '<CLIENT_ID>',
metadata: {
'referenceId': '1001',
},
);
},
child: const Text('Start Verification'),
),
),
);
}
}
Parameters #
| Parameter | Type | Description |
|---|---|---|
context |
BuildContext |
Build context used to navigate into the verification flow. |
userToken |
String |
The user API token retrieved from the user profile. |
trustFlowId |
int |
ID of the verification trust flow to launch. |
clientId |
String |
The client ID retrieved from the user profile page. |
metadata |
Map<String, dynamic>? |
Optional key-value JSON sent back to your webhook. |
licenseKeys |
IdmetaLicenseKeys? |
Optional capture licences issued for your app ID. See Your own capture licences. |
Verification result #
startVerification completes when the flow closes and tells you how it
ended:
final result = await IdmetaFlutter.startVerification(
// ...
);
switch (result.status) {
case IdmetaVerificationStatus.completed:
// Submitted. result.verificationId is the ID your webhook receives.
break;
case IdmetaVerificationStatus.cancelled:
// The applicant left before finishing.
break;
case IdmetaVerificationStatus.failed:
// The verification couldn't start; result.errorMessage says why.
break;
}
| Status | When | verificationId |
errorMessage |
|---|---|---|---|
completed |
The applicant finished every step. | Set | null |
cancelled |
The applicant left before finishing. | Set if the verification was already created | null |
failed |
The flow couldn't start, for example no internet connection or a trust flow that wasn't found. | null |
Why, worded for the applicant |
completed means the verification was submitted, not that it was approved.
The decision is sent to your webhook.
Your own capture licences #
Document capture licences are tied to an app ID. By default the plugin
loads them from IDmeta for your clientId. If the licences on your IDmeta
account were issued for a different app ID, pass licences issued for your app:
IdmetaFlutter.startVerification(
// ...
licenseKeys: const IdmetaLicenseKeys(
documentVerification: '<DOCUMENT_VERIFICATION_LICENSE>',
documentVerificationV2: '<DOCUMENT_VERIFICATION_V2_LICENSE>',
),
);
Every key is optional. Any key you leave out is still loaded from IDmeta.
Example Metadata #
metadata: {
'referenceId': '1001',
'userId': 'USER-123',
'environment': 'staging',
}
Platform Configuration #
Configure your IDmeta account and backend to obtain the values used above:
- Create a Trust Flow and retrieve Trust Flow ID — Creating a Trust Flow
- Communication between IDmeta and your backend server via webhook — Adding Webhooks to Trust Flow
- Getting API Tokens — App Tokens
- Webhook responses follow the same structure as the IDmeta API — API Reference
Notes #
- The plugin requires an active internet connection during verification.
- Metadata values are returned in webhook callbacks for tracking and reconciliation purposes.
Support #
For integration support or issues, please contact the IDmeta team.
License #
This plugin package is licensed under the MIT License.
IDmeta verification services require a valid IDmeta account, userToken,
trustFlowId, and applicable customer agreement. Available verification
features depend on your subscription and trust-flow configuration. Reseller,
OEM, or multi-application deployment may require a separate written agreement
with IDmeta.
Bundled third-party native SDKs are governed by their respective vendor licenses and your IDmeta license entitlements.