CredflareDevelopersOpen dashboard
Preview

Kotlin SDK

A native flow for Android 7.0 (API 24) and newer that collects the requested documents, runs the liveness challenge and location step, and sends the evidence for review.

Not published to Maven. The source is on GitHub at credflare/kotlin-sdk. Add its sdk module as a Gradle project dependency. Imports use net.credflare.sdk.

Add the guided flow

import net.credflare.sdk.CredflareVerification
import net.credflare.sdk.SessionDescriptor
import net.credflare.sdk.SessionProvider
import net.credflare.sdk.VerificationResult

CredflareVerification.launch(activity, SessionProvider {
    SessionDescriptor.fromJson(yourBackend.createApplicantSession()) // runs on a worker thread
}) { result ->
    when (result) {
        VerificationResult.SUBMITTED -> refreshStatus()
        VerificationResult.HOST_ACTION_REQUIRED -> showYourOwnSteps()
        VerificationResult.CANCELLED -> Unit
        VerificationResult.FAILED -> showRetry()
    }
}

The provider calls your own authenticated backend, which creates the session as shown in the server example. launch returns false when a flow is already open.

ResultMeaning
SUBMITTEDNothing is left to collect. This is a receipt, not a decision.
HOST_ACTION_REQUIREDThe SDK collected what it can, but the case still needs something your app handles: founders questions, checks the SDK does not collect, or a leave rejection.
CANCELLEDThe applicant closed the flow. The case stays open.
FAILEDThe flow could not start, for example because the provider threw.

The flow collects the documents, then the questions, then the case's facial, location, email and phone requirements in profile order, then shows the receipt.

To learn which rejection the applicant left from, use launchWithOutcome. Its VerificationOutcome has the result and, after a leave rejection, the rejectionCode, such as phone.not_configured.

CredflareVerification.launchWithOutcome(activity, provider) { outcome ->
    if (outcome.result == VerificationResult.HOST_ACTION_REQUIRED && outcome.rejectionCode != null) {
        offerAnotherWay(outcome.rejectionCode)
    }
}

Liveness and location

Questions and codes

Not yet on production: questions, email and phone codes, fetching the session after each submit, and rejection screens with a help contact. They need API and SDK versions that are not released yet.

Build your own screens

VerificationSession offers get(), upload(), createLivenessChallenge(), uploadBiometric(), submit(), submitFacial(), submitLocation(), requestCode(), confirmCode(), submitAnswers(), replaceSession() and cancel(). They block, so call them off the main thread. Uploads and submissions take a UUID retry key. Reuse the key with the same evidence after a network failure.

Configure the app

Read how the SDKs work for capture methods, receipts and error handling.