6. Initiating Verifications
To initiate a verification, you will need two key elements: a token
and launch configurations.
Generate a Token:
The first step is to generate a token for verification. You can find information on how to generate a token hereLaunch configurations:
The SDK provides two configurations —Regular
andStripped
— to control the flow of the verification process. Each configuration also requires you to set anSdkMode
and, in some cases, aCameraOption
.
1. Stripped configuration​
The Stripped configuration offers a minimalistic flow with just two screens: a loading screen
and a camera capture screen
. This streamlined approach allows for faster verifications.
When using the Stripped configuration, you must specify:
SdkMode
: Determines whether to run afull KYC verification
or aLiveness-only check
. The available modes are:SdkMode.KYC
: Default mode for full KYC verification.SdkMode.LIVENESS
: For Liveness-only verification.
CameraOption
: Allows you to specify the camera to be used (eitherFRONT
orBACK
).
Here’s how to create the intent for launching the SDK in Stripped
mode:
val intent = Metric.createStartIntent(
token = "token here...",
launchConfiguration = LaunchConfiguration.Stripped(
sdkMode = SdkMode.KYC, // or SdkMode.LIVENESS
cameraOption = CameraOption.FRONT // or CameraOption.BACK
)
)
2. Regular Configuration​
The Regular
Configuration provides a more comprehensive, user-friendly experience. It includes:
Capture Instructions: Guides users on how to capture the images properly.
Preview Screens: Allows users to view and recapture images if necessary.
Auto-recapture: Automatically attempts to recapture if the images do not meet standards.
Permission Handling: Manages permission denial scenarios for smoother operation.
Here’s how to create the intent for launching the SDK in Regular
mode:
val intent = Metric.createStartIntent(
token = "token here...",
launchConfiguration = LaunchConfiguration.Regular(
sdkMode = SdkMode.KYC // or SdkMode.LIVENESS
//The camera selection is automatically handled by the SDK.
)
)
Launching the SDK​
Once you've generated a token and chosen your configuration (Stripped or Regular), you can launch the SDK using the following code:
private const val METRIC_SDK_REQUEST_CODE: Int = 99
startActivityForResult(intent, METRIC_SDK_REQUEST_CODE)