Skip to content
CheckMobi Remote Config SDK For Android
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
checkmobi
gradle/wrapper
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

remote-config-sdk-android

CheckMobi Remote Config SDK For Android

Overview

CheckMobi Remote Config SDK for Android allows the users to integrate CheckMobi validation methods on Android in a very efficient and flexible manner without wasting their time to write the logic for any validation flow.

Features

  • Integration with few lines of code
  • Allow theme customization
  • You can change the verification flow directly from the CheckMobi website, on the fly, without deploying a new client version.
  • The CheckMobi complete suite of verification products (SMS, Voice, Missed Call) creates a variety of flows that you can test instantly with few lines of code.
  • Customize different validation flows by country, operator or even number and split test to validate improvements.
  • It's completely open source. In case the API doesn't allow you to customize the UI as you wish, you can anytime clone it and change the code.

Testing

The repo contains a demo app which can be used to test the product without having to integrate into a new project.

In order to do this just:

  • Clone the repo
  • Open the project in Android Studio
  • Open StartActivity.java and search for the variable CHECKMOBI_SECRET_KEY and set it's value to your CheckMobi Secret Key from web portal.
  • Run the project on a device

Integrate the SDK into your project

In order to integrate the SDK into your project (using Android Studio), follow the next steps:

  • Clone the project
  • Into Android Studio go to: File -> New -> Import Module
  • Choose the source of the module that you just cloned (<path to cloned project>/checkmobi) and press Finish

Set the API Secret Key

In order to use the SDK you need in the first time to set the CheckMobi Secret Key from the web portal. You can do this somewhere before calling any SDK method by calling:

CheckmobiSdk.getInstance().setApiKey("YOUR_SERET_KEY_HERE");

Integrate the phone validation process

The first thing you need to do is to check if the user has already verified his number. You can do this like so:

String verifiedNumber = CheckmobiSdk.getInstance().getVerifiedNumber(<context>);

If verifiedNumber is not null, your user has verified his number and you should allow him to continue using the app otherwise you should redirect him to the validation process.

To start a validation process you should add the following lines of code:

startActivityForResult(
    CheckmobiSdk.getInstance()
        .createVerificationIntentBuilder()
        .build(StartActivity.this), VERIFICATION_RC);

You should also override the onActivityResult method like so:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == VERIFICATION_RC) {
        if (resultCode == RESULT_OK) {
            //The user has verified his phone number successfully
        } else {
            //The user canceled the verification process
        }
    }
}

Customizations

You can change the theme used in the activities by setting you theme in the VerificationIntentBuilder before you start it like so:

startActivityForResult(
    CheckmobiSdk.getInstance()
        .createVerificationIntentBuilder()
        .setTheme(<your theme>)
        .build(StartActivity.this), VERIFICATION_RC);

Since this is an Android module, if you need to customize it even more, you are free to change the code.

Behind the scene

Behind the scene the SDK is using the CheckMobi REST API.

First is doing a call to Get Remote Config Profile which returns the validation flow for the specified destination as configured in the CheckMobi Web Portal.

Then based on the profile received the app it's using the Request Validation API and Verify PIN API to implement the desired validation processes.

The select country picker is populated using the information received from Get Countries API.

You can’t perform that action at this time.