Android

Use a Custom Tab to launch CLEAR's UI in your Android app

Overview

Launch the verification UI in a Android Custom Tab and handle the results at the redirect URL.

🚧

Note on WebViews

Clear requires our partners to invoke the WebView as an Android Custom Tab. CLEAR blocks non secure WebViews and iFrames in production as it is a security concern. For more information, please contact your dedicated CLEAR point of contact.

When the user is finished, query the VerificationSession from your backend and check the status field.

Our API Reference has more details on the specifics of the API endpoints.

📘

Specify a redirect

Make sure to set the redirect_url field when you create the VerificationSession! We will use this redirect_url to send the user back to your app when the verification is complete.

Launch a CustomTab

To launch the CustomTab, you'll first need the token from step 1 to construct a URL with the token as a query parameter: https://verified.clearme.com/verify/?token=<VERIFICATION_TOKEN>. Pass that URL to the Custom Tab.

Handle redirects

When the user successfully completes the verification, the UI will redirect to the redirect_url you specified when you created the Verification Session.

✍️

Note on redirects

Not all users who are redirected are verified. A successful redirect does not equate a successful verification. You will still need to retrieve the verification using the /v1/verification_sessions/{id} endpoint from your backend after the redirect to know if a user is verified.

Testing the user flow

The user flow initially begins in CLEAR's sandbox environment where all data returned is mocked.

To test with CLEAR's sandbox mode, use your sandbox API key. Verification sessions created in sandbox mode don't send OTPs or validate data entered.

Controlling the UI in sandbox mode is easy; just enter 123456 into the OTP input box or use the Demo/Testing Tools at the bottom of the UI to "Skip" the steps.

To see a return user flow, open a new verification session link and input the magic number +1-408-222-2222 and flow the same steps as listed above.


What’s Next

After defining where end users will verify, configure a project to customize your verification needs

Did this page help you?