Skip to main content

Quick start

Veriph.One offers a swift solution for adding phone verification to any mobile application. This guide will walk you through the process of integrating Veriph.One, initiating a verification, and retrieving a result in your app using our SDK, thereby enhancing the security and reliability of your platform.

Before diving into the integration process, let's ensure you're well-prepared. Here's what you should have:

  1. You have a working Android app project you want to integrate.
  2. You have read our Introduction article that explains how the integration works.
  3. You already have a Veriph.One account and have obtained API Keys for your mobile environments; see how to do so here.
  4. Your server or backend has the Start and Result Endpoints ready for use by your app. Follow this guide if you need to complete this step.
  5. (Optional) You visited our demo app to see what our SDK can help you accomplish.

Technical considerations

We built our Android SDK with a balance between backward compatibility and modern APIs in mind; as such:

  1. It's a native SDK that most platforms should support, even non-native ones. If you find that inaccurate, please let us know, and we'll help you integrate it into your stack. 
  2. It was built using Kotlin + Jetpack Compose and on top of the latest best practices in the industry.
  3. it requires at least SDK level 21 (Android 5.0—Lollipop) for maximum compatibility and covers over 99% of active devices.
  4. Requires no special permissions beyond internet connectivity.
  5. It was designed to be as lightweight and performant as possible, allowing the developer the best experience attainable. Still, we continuously strive to push our limits in this regard.

Installation

Veriph.One distributes its Android SDK through Maven Central. Installing the dependency is a simple process:

  1. Ensure your project-level's Gradle settings file includes Maven Central as a repository. Example:
/settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}
  1. Add the dependency to your module-level Gradle file, replacing the version string. Our latest version is:

Maven Central Version

/{your-module}/build.gradle.kts
dependencies {
implementation("one.veriph:veriph-one-android-sdk:{version}")
}

Permissions

Please ensure your application includes the following permissions in its manifest file. They are required for our SDK to function correctly:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

API Keys

Our SDK requires an Android or Generic Mobile API Key to operate; however, these values shouldn't live hardcoded in your app and should never be committed to a code repository. Doing so would expose your company to security leaks and vulnerabilities. For this reason, we recommend you leverage a keystore.properties file that you include in your git.ignore.

/keystore.properties
VERIPH_ONE_DEV_API_KEY={YOUR_DEV_API_KEY}
VERIPH_ONE_PROD_API_KEY={YOUR_PROD_API_KEY}

With the file and values in place you can later setup your module-level Gradle file following the example below. We show a configuration for multiple environments based on your build type.

/{your-module}/build.gradle.kts
android {
buildFeatures {
buildConfig = true
}

defaultConfig {
val properties = Properties()
properties.load(project.rootProject.file("keystore.properties").inputStream())
buildConfigField(
"String",
"VERIPH_ONE_API_KEY",
"\"${properties.getProperty("VERIPH_ONE_DEV_API_KEY")}\""
)
}

buildTypes {
release {
val properties = Properties()
properties.load(project.rootProject.file("keystore.properties").inputStream())
buildConfigField(
"String",
"VERIPH_ONE_API_KEY",
"\"${properties.getProperty("VERIPH_ONE_PROD_API_KEY")}\""
)
}
}
}

After building and compiling your project (Android Studio's 'Make project' command), your BuildConfig will make the key accessible to your code. This is how you can get it anywhere in your Kotlin code:

val apiKey = BuildConfig.VERIPH_ONE_API_KEY