IHCaptcha

hCaptcha client which allows invoking of challenge completion and listening for the result.

Usage example:
1. Get a client either using the site key or customize by passing a config:
client = HCaptcha.getClient(this).verifyWithHCaptcha(YOUR_API_SITE_KEY)
client = HCaptcha.getClient(this).verifyWithHCaptcha([com.stripe.hcaptcha.config.HCaptchaConfig])

// Improve cold start by setting up the hCaptcha client
client = HCaptcha.getClient(this).setup([com.stripe.hcaptcha.config.HCaptchaConfig])
// ui rendering...
// user form fill up...
// ready for human verification
client.verifyWithHCaptcha();
2. Listen for the result and error events:

client.addOnSuccessListener(new OnSuccessListener<HCaptchaTokenResponse>() {

Inheritors

Functions

Link copied to clipboard
abstract fun reset()

Force stop verification and release resources.

Link copied to clipboard
abstract fun setup(config: HCaptchaConfig): HCaptcha?

Constructs a new client which allows to display a challenge dialog

Link copied to clipboard
abstract fun verifyWithHCaptcha(): HCaptcha?

Presents a captcha challenge. Depending on the configuration passed in setup, this will be either a passive challenge or a dialog to be completed by the user.