/rx-recaptcha

An easy way to use SafetyNet reCAPTCHA with RxJava2

Primary LanguageKotlinApache License 2.0Apache-2.0

rx-recaptcha

Download Android Arsenal CircleCI
An easy way to use SafetyNet reCAPTCHA with RxJava2

Usage

1. Register a reCAPTCHA key pair

To register a key pair for use with the SafetyNet reCAPTCHA API, navigate to the reCAPTCHA Android signup site

2. Add dependency

dependencies {
    implementation "com.tomasznajda.rxrecaptcha:rxrecaptcha:16.0.0.2"
}

3. Use reCAPTCHA verification inside your Android app

ReCaptcha()
        .verify(context = this, siteKey = YOUR_SITE_KEY)
        .subscribeBy(
                onSuccess = { printToken(token = it) },
                onError = { printError(error = it) })

4. Validate reCAPTCHA response token

To learn how to validate the user's response token, see Verifying the user's response

Usage of sample

  1. Register a reCAPTCHA key pair: reCAPTCHA Android signup site
  2. Put your "Site key" inside MainActivity#YOUR_SITE_KEY constant
  3. Compile & run the app

Useful links