Integration
Add the SDK
Add the Microblink Maven repository to your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven { url = uri("https://maven.microblink.com") }
}
}
Then add the SDK, and the scanning SDKs that your workflows need, to your app's build.gradle.kts:
dependencies {
implementation(platform("com.microblink:microblink-platform-bom:2.0.0"))
implementation("com.microblink:microblink-platform")
// Only the ones your workflows need:
implementation("com.microblink:blinkid-verify-ux")
implementation("com.microblink:blinkcard-ux")
implementation("com.microblink:biometrics-ux")
}
The SDK consists of three artifacts:
com.microblink:microblink-platform: our verification screens, which most integrations use.com.microblink:microblink-platform-engine: the engine, which runs the verification session, and provides the configuration and result types.com.microblink:microblink-platform-bom: the BOM, which sets the versions of the SDK and of the scanning SDKs.
microblink-platform brings in microblink-platform-engine, so don't add it separately, unless you want to build your own UI on the engine alone.
Read Platform SDK architecture.
Scanning SDKs
The engine doesn't bring in the document scanning, card scanning, and face capture SDKs. Add the ones that the steps of your workflows use, without a version, so that the BOM sets it:
- Document scanning and document verification steps:
com.microblink:blinkid-verify-ux - Card scanning steps:
com.microblink:blinkcard-ux - Face capture steps:
com.microblink:biometrics-ux
Only the versions from the BOM are supported.
If a workflow has a step whose scanning SDK your app doesn't include, the verification fails with EngineError.MissingScannerSdk.
Initialization
The SDK uses AndroidX App Startup to follow which of your app's activities is in front, so that it can start the camera steps from it. App Startup initializes it automatically when your app starts, so in most apps you have nothing to do.
If your app turns off App Startup's automatic initialization, or runs the verification in a separate process, initialize the SDK yourself in Application.onCreate, before any activity starts:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
AppInitializer.getInstance(this).initializeComponent(EngineInitializer::class.java)
}
}
Until the SDK is initialized, a verification can't start.
Start a verification
Call MicroblinkPlatform.startVerification from the main thread, with the sdkConfiguration your backend returned:
MicroblinkPlatform.startVerification(
activity = this,
configuration = MicroblinkPlatformConfiguration(
engine = EngineConfiguration(
service = ServiceSettings(sdkConfiguration = sdkConfiguration)
),
resultListener = resultListener,
)
)
See Configuration for all fields, and Verification flow for how to handle the outcome.