Skip to main content

Launch a verification

Since our SDK does the heavy lifting and your server handles most of the communication, launching a new verification on your mobile app is quite simple. You only need to create a button or interactive element in your UI that triggers the following flow when the user taps on it:

Step 1: Get a session UUID

The first step is for your app to hit the Start Endpoint provided by your backend. Based on how you or your team decided to implement this endpoint, you might need to pass some parameters for your backend to link the request to a specific user or transaction. Veriph.One doesn't explicitly ask for this to happen in a certain way; you and your team define how to approach this.

tip

We recommend that you pass the user's current locale to this endpoint to ensure that our UI localizes all the texts and elements correctly during the verification flow.

Step 2: Launch the SDK

Assuming the endpoint functions correctly, you should have a valid verification session UUID. Using the code below, you will use this UUID and your Android or Generic Mobile API Key to launch our SDK.

import one.veriph.sdk.ui.util.VerificationParams
import one.veriph.sdk.ui.util.VerificationResultContract

class MyActivity : ComponentActivity() {

private val startForResult =
registerForActivityResult(VerificationResultContract()) { result: String? ->
if (result != null) {
// Verification has a result ready (could be successful or failed)
// Connect to your Result Endpoint for further instructions.
// More on this on the next section of the tutorial.
} else {
// Verification failed or was interrupted.
// Option 1: Do nothing.
// Option 2: Ask server for further instructions.
}
}

private val launchVerification: (sessionUuid: String) -> Unit = {
// Your API Key can be obtained as you see fit,
// as long as it is obtained securely
val apiKey = BuildConfig.VERIPH_ONE_API_KEY
startForResult.launch(VerificationParams(it, apiKey))
}
}

Our SDK provides both VerificationParams and VerificationResultContract, which will help you launch a verification effortlessly. The startForResult object triggers our verification Activity when startForResult.launch is called, and it will return a result to your app once one is available. You can wrap this process in a function like launchVerification that you can call once a session UUID is ready.

As soon as the process is launched, our UI will take over, and the user will be prompted to complete the phone verification process.