Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Vonage/number-verification-sdk-android

Repository files navigation

⚠️ This Library has been deprecated in favour of the Vonage Client Library ⚠️

com.vonage.client-sdk-number-verification

Vonage Number Verification uses a mobile phone's Subscriber Identity Module (SIM) to prove a user's identity. This SDK enables making a HTTP request over cellular even when on WiFi. This SDK is designed to be used as part of a Number Verification flow, please read the guide for more information.

Installation

build.gradle -> dependencies add

implementation 'com.vonage:client-sdk-number-verification:1.1.1'

Usage

    VGNumberVerificationClient.initializeSdk(this.applicationContext)

    val params = VGNumberVerificationParameters(
        url = "http://www.vonage.com",
        headers = mapOf("x-my-header" to "My Value") ,
        queryParameters = mapOf("query-param" to "value"),
        maxRedirectCount = 10
    )

    val response = VGNumberVerificationClient.getInstance().startNumberVerification(params, true)
    if (response.optString("error") != "") {
        // error
    } else {
        val status = response.optInt("http_status")
        val jsonReponse = response.getJSONObject("response_body") // Body of response parsed to JSON (NULL if not JSON)
        val rawReponse = response.optString("response_raw_body") // RAW string of response body (Only populated if not JSON)
        if (status == 200) {
            // 200 OK
        } else {
            // error
        }
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages