RecaptchaTasksClient

interface RecaptchaTasksClient


A client that enables Android Apps to trigger reCAPTCHA Enterprise.

Summary

Public functions

Task<String>
executeTask(recaptchaAction: RecaptchaAction)

Executes reCAPTCHA Enterprise on a user action.

Task<String>
executeTask(recaptchaAction: RecaptchaAction, timeout: Long)

Executes reCAPTCHA Enterprise on a user action.

Public functions

executeTask

fun executeTask(recaptchaAction: RecaptchaAction): Task<String>

Executes reCAPTCHA Enterprise on a user action.

This method will throw a timeout exception after 5 seconds.

Parameters
recaptchaAction: RecaptchaAction

The user action to protect.

Returns
Task<String>

A Task that would resolve with a reCAPTCHA Enterprise token.

executeTask

fun executeTask(
    recaptchaAction: RecaptchaAction,
    timeout: Long = DEFAULT_TIMEOUT_EXECUTE
): Task<String>

Executes reCAPTCHA Enterprise on a user action.

It is suggested the usage of 10 seconds for the timeout. The minimum value is 5 seconds.

Parameters
recaptchaAction: RecaptchaAction

The user action to protect.

timeout: Long = DEFAULT_TIMEOUT_EXECUTE

Maximum amount of time of execute() call in milliseconds.

Returns
Task<String>

A Task that would resolve with a reCAPTCHA Enterprise token.