Configuration
The Android SDK is configured through MicroblinkPlatformConfig, which you pass to MicroblinkPlatform.startVerification:
MicroblinkPlatform.startVerification(
activity = this,
config = MicroblinkPlatformConfig(
mbpResultListener = ...,
mbpServiceSettings = MicroblinkPlatformServiceSettings(
workflowId = "...",
proxySettings = MicroblinkPlatformProxySettings(
url = "..."
),
consent = MicroblinkPlatformConsent(
userId = "...",
isProcessingStoringAllowed = true,
givenOn = "..."
)
)
)
)
See the quickstart for a full integration example.
Configuration object
MicroblinkPlatformConfig(
mbpResultListener = ...,
mbpServiceSettings = ...,
mbpUiSettings = ..., // optional
mbpCardScanResultListener = ..., // optional
)
Required fields
You must set the following fields. Other fields are optional and are described in the Optional fields section.
mbpResultListener
MicroblinkPlatformConfig(
mbpResultListener = object : MicroblinkPlatformResultListener {
override fun onVerificationFinished(mbpResult: MicroblinkPlatformResult) { ... }
override fun onVerificationCanceled(cancelState: MicroblinkPlatformCancelState) { ... }
},
...
)
The listener that receives verification results and cancellation events. See Listener methods below for details on each callback.
mbpServiceSettings
MicroblinkPlatformConfig(
...
mbpServiceSettings = MicroblinkPlatformServiceSettings(
workflowId = "example123",
proxySettings = MicroblinkPlatformProxySettings(
url = "https://your.proxy.server"
),
consent = MicroblinkPlatformConsent(...)
)
)
This field holds configuration options for how the SDK communicates with the proxy and the Platform API.
workflowId
MicroblinkPlatformServiceSettings(
workflowId = "example123",
...
)
This is the ID of your workflow.
You can get the workflowId from the Platform dashboard.
proxySettings.url
MicroblinkPlatformProxySettings(
url = "https://your.proxy.server",
...
)
The url is the base URL of the proxy service you are hosting.
By default, the SDK appends /transaction to this value when creating new transactions.
If you're using our proxy (latest version), you don't need to change anything.
For additional proxy settings (additional headers, specifying different proxy path values etc.), see the proxy reference.
consent
Consent is a mandatory field where you provide a unique user identifier and the user's consent to process their data.
You provide the consent by setting the isProcessingStoringAllowed flag to true.
If it is not set, we will show our own consent form to the user.
If they reject, the transaction will be abandoned.
Never reuse the same user ID for multiple users. Each consent to process someone's personal data must be accompanied by a unique identifier that can be used to associate this consent with the person who gave it.
MicroblinkPlatformConsent(
// Required:
userId = "...",
isProcessingStoringAllowed = true,
// Optional:
isTrainingAllowed = true,
givenOn = "...",
note = null
)
isTrainingAllowed: set totrueto allow the user's data to be used for training machine learning models; defaults tofalse.givenOn: a UTC timestamp in milliseconds for when consent was given; optional, but must be provided ifisProcessingStoringAllowedis true.
Optional fields
mbpUiSettings
MicroblinkPlatformUiSettings(
colorScheme = lightColorScheme(
primary = Cobalt,
background = Color.White,
),
typography = MicroblinkPlatformTypography.default(myFontFamily),
documentScanningTypography = ParcelableUiTypography.Default(myFontFamily),
mbpImages = MicroblinkPlatformImages(
home = R.drawable.my_home,
verificationSuccess = R.drawable.my_success,
verificationFail = R.drawable.my_fail,
verificationReview = R.drawable.my_review,
cameraPermission = R.drawable.my_camera_permission,
),
buttonShape = ButtonShape(shape = CircleShape),
)
Customizations include:
colorScheme: anandroidx.compose.material3.ColorSchemecontrolling button and background colors throughout the SDK.typography: controls fonts across the SDK UI screens.documentScanningTypography: controls fonts specifically within the document capture screens.mbpImages: used to replace the default images on the home, result, and camera permission screens.buttonShape: controls the corner shape of action buttons on the home, error, camera permission, and result screens
Read more about how to customize your Android SDK integration.
mbpCardScanResultListener
MicroblinkPlatformConfig(
...
mbpCardScanResultListener = object : MicroblinkPlatformCardScanResultListener {
override fun onCardScanned(cardResult: CardScanResult) {
// cardResult.cardNumber
}
}
)
An optional listener for receiving card scan results during the flow.
CardScanResult contains cardNumber.
Listener methods
Verification finished
override fun onVerificationFinished(mbpResult: MicroblinkPlatformResult) {
when (mbpResult.state) {
MicroblinkPlatformResult.FinishedState.Accept -> { ... }
MicroblinkPlatformResult.FinishedState.Reject -> { ... }
MicroblinkPlatformResult.FinishedState.Review -> { ... }
}
val transactionId = mbpResult.transactionId
}
Called when the transaction finishes.
MicroblinkPlatformResult contains:
state:Accept,Reject, orReviewtransactionId: the unique identifier of the completed transaction
Verification canceled
override fun onVerificationCanceled(cancelState: MicroblinkPlatformCancelState) {
when (cancelState.cancelReason) {
MicroblinkPlatformCancelState.CancelReason.UserCanceled -> { ... }
MicroblinkPlatformCancelState.CancelReason.ConsentDenied -> { ... }
}
val transactionId = cancelState.transactionId
}
Called when the user exits the workflow before completion.
MicroblinkPlatformCancelState contains:
cancelReason:UserCanceledorConsentDeniedtransactionId: the transaction ID, if available at the time of cancellation