For Flutter 8.24.0 and above or Android Gradle plugin 8.0.0 and above, add to android/gradle.properties:
android.nonTransitiveRClass=false
The minimum SDK version should be 21 or higher:
defaultConfig {
...
minSDKVersion 21
...
}
For iOS, set the minimum platform to 13 or higher in the Runner → Info → Deployment target → iOS Deployment Target.
In ios/Podfile, comment the use_frameworks! line (#use_frameworks!).
Getting Started with Flutter
Initializing SDK
Initialize SDK by calling the init plugin method. Note that the license file name and path should match the ones specified in pubspec.yaml (e.g., assets/license.json).
await OZSDK.initSDK([<% license path and license file name %>]);
Connecting SDK to API
Use the API credentials (login, password, and API URL) that you’ve received from us.
In production, instead of hard-coding the login and password inside the application, it is recommended to get the access token on your backend via the API auth method, then pass it to your application:
final analysisResult = await OZSDK.analyze(analysis, [], {}) ?? [];
The analysisResult list of objects contains the result of the analysis.
If you want to use media captured by another SDK, the code should look like this:
media = Media(FileTypedocumentPhoto, VerificationAction.oneShot, “photo_selfie”, null, <path to image>, null, null, “”)
The whole code block will look like this:
// replace VerificationAction.blank with your Liveness gesture if needed
final cameraMedia = await OZSDK.executeLiveness([VerificationAction.blank], use_main_camera);
final analysis = [
Analysis(Type.quality, Mode.serverBased, cameraMedia, {}),
];
final analysisResult = await OZSDK.analyze(analysis, [], {});
// replace VerificationAction.blank with your Liveness gesture if needed
final cameraMedia = await OZSDK.executeLiveness([VerificationAction.blank], use_main_camera);
final biometryMedia = [...cameraMedia];
biometryMedia.add(
Media(
FileType.documentPhoto,
VerificationAction.blank,
MediaType.movement,
null,
<your reference image path>,
null,
null,
MediaTag.photoSelfie,
),
);
final analysis = [
Analysis(Type.quality, Mode.serverBased, cameraMedia, {}),
Analysis(Type.biometry, Mode.serverBased, biometryMedia, {}),
];
final analysisResult = await OZSDK.analyze(analysis, [], {});
By default, logs are saved along with the analyses' data. If you need to keep the logs distinct from the analysis data, set up the separate connection for as shown below: