Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Twilio Verification SDK for Android - Integration guide


overview page anchor

The following is the high level overview of how the SDK works to simplify the process of validating a phone number within an application running on Android.

Required components

required-components page anchor
Twilio Verification SDK for Android - Architecture scheme.
  1. A mobile application with the SDK installed.
  2. A backend service to receive phone numbers from the App and produce a signed JWT
  3. Have access to Twilio Verification API in the backend, have your mobile application's hash configured within Twilio
High level flow.
  1. App requests to the backend to sign the phone number.
  2. Backend transforms phone number into a JWT. The JWT is the phone number, signed with the customer's AUTHY_API_KEY and an expiration time
  3. Backend sends JWT to Android application.
  4. The Android app, with the JWT, starts the verification with the SDK.
  5. Twilio sends a formatted SMS (including a prefix and a hash) to the device.
  6. Twilio Verification SDK reads the SMS in the background and notifies the app. No SMS_READ permission is needed. The app with the provided result will have a verification token that is proof enough that the phone is valid.

Along this guide we're going to implement a sample app from scratch, integrated with the Twilio Verification SDK and supported by a sample token server.

There's also a more complete sample app already implemented.

The code can be directly checked out here: Sample app(link takes you to an external page) - Token Server(link takes you to an external page)

The following guides will help you integrate the SDK step by step

the-following-guides-will-help-you-integrate-the-sdk-step-by-step page anchor
  1. Integrating Twilio Verification SDK using the sample backend
  2. Integrating the Twilio Verification SDK with your own backend
  3. Register your app in Twilio Verification API
  4. SDK Reference

Once the SDK is integrated in your app and your backend is capable of generating the JWT, you're good to go.

You can also make use of the Google's sign-in hint, which auto-fills connected phone numbers for the user and reduce the friction even further. Check out the official documentation(link takes you to an external page) or ask our support team for more information on how to use Google's sign-in hint.

The Twilio Verification Sample App has implemented this feature and is available in github(link takes you to an external page)

It will also be implemented in the latest release of the Authy app, starting roll out on May 2017

Download Authy from the Google Play Store(link takes you to an external page)

Rate this page: