https://github.com/vonage/number-verification-sdk-android
https://github.com/vonage/number-verification-sdk-android
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vonage/number-verification-sdk-android
- Owner: Vonage
- License: apache-2.0
- Created: 2024-02-13T14:04:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-12T15:14:24.000Z (about 1 year ago)
- Last Synced: 2024-04-12T22:46:19.177Z (about 1 year ago)
- Language: Kotlin
- Size: 134 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :warning: This Library has been deprecated in favour of the [Vonage Client Library](https://github.com/Vonage/vonage-android-client-library) :warning:
# com.vonage.client-sdk-number-verification
[Vonage Number Verification](https://developer.vonage.com/en/number-verification/overview) 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](https://developer.vonage.com/en/getting-started-network/authentication) for more information.
## Installation
build.gradle -> dependencies add
```
implementation 'com.vonage:client-sdk-number-verification:1.1.1'
```## Usage
```kotlin
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
}
}
```