Flow
Starting the SDK
To start the SDK, call MicroblinkPlatform.startVerification method with the prepared configuration:
MicroblinkPlatform.startVerification(this, createMbpConfig())
Configuration example:
private fun createMbpConfig() = MicroblinkPlatformConfig(
mbpResultListener = mbpResultListener,
mbpServiceSettings = MicroblinkPlatformServiceSettings(
// IMPORTANT: Replace the following values with your own
workflowId = "your_workflow_id",
hostUrl = "your_host_url",
// add your additional request headers if needed, e.g. for authorization
additionalRequestHeaders = mapOf("Authorization" to "Bearer your_token"),
),
mbpUiSettings = MicroblinkPlatformUiSettings(
// customize the UI if needed
),
consent = MicroblinkPlatformConsent(
// replace with real user ID
userId = "user_id",
// Represents collected end-user's consent for their data
// to be processed and stored by Microblink.
// The end-user's consent is required for us to be able to complete the KYC verification.
isProcessingStoringAllowed = true,
// Additionally, represents collected end-user's consent for their
// data to be used by Microblink for the improvement of the
// fraud detection capabilities in our own products (ie. for training our models).
isTrainingAllowed = true,
)
)
Retrieving information
Verification results are returned via MicroblinkPlatformResultListener
private val mbpResultListener = object : MicroblinkPlatformResultListener {
override fun onVerificationFinished(result: MicroblinkPlatformResult) {
when (result.state) {
MicroblinkPlatformResult.FinishedState.Success -> // Handle successful verification
MicroblinkPlatformResult.FinishedState.Failure -> // Handle failed verification
MicroblinkPlatformResult.FinishedState.Review -> // Handle verification that requires manual review
}
// use the transaction ID if needed
val transactionId = result.transactionId
}
override fun onVerificationCanceled() {
// Handle verification cancellation
}
}