Skip to content

tomasznajda/rx-recaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b53db2f · Apr 17, 2019

History

38 Commits
Apr 17, 2019
Apr 17, 2019
Apr 17, 2019
Apr 17, 2019
Apr 4, 2018
Apr 4, 2018
Dec 4, 2018
Apr 17, 2019
Apr 4, 2018
Apr 4, 2018
Apr 4, 2018
Apr 11, 2018

Repository files navigation

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