Recaptcha

public static class Recaptcha


Summary

Public fields

static @NonNull Recaptcha

Public methods

final @NonNull Result<@NonNull RecaptchaClient>
getClient(
    @NonNull Application application,
    @NonNull String siteKey,
    long timeout
)

Returns a Result of RecaptchaClient associated with the siteKey to access all reCAPTCHA APIs.

static final @NonNull Task<@NonNull RecaptchaTasksClient>
getTasksClient(@NonNull Application application, @NonNull String siteKey)

Returns a Task of RecaptchaTasksClient associated with the siteKey to access all reCAPTCHA APIs.

static final @NonNull Task<@NonNull RecaptchaTasksClient>
getTasksClient(
    @NonNull Application application,
    @NonNull String siteKey,
    long timeout
)

Returns a Task of RecaptchaTasksClient associated with the siteKey to access all reCAPTCHA APIs.

Public fields

INSTANCE

public static @NonNull Recaptcha INSTANCE

Public methods

getClient

public final @NonNull Result<@NonNull RecaptchaClientgetClient(
    @NonNull Application application,
    @NonNull String siteKey,
    long timeout
)

Returns a Result of RecaptchaClient associated with the siteKey to access all reCAPTCHA APIs.

The SDK currently supports one Site Key. Passing a different Site Key will throw an exception.

At least a 10000 millisecond timeout is suggested to allow for slow networking, though in some cases longer timeouts may be necessary. The minimum allowable value is 5000 milliseconds.

Parameters
@NonNull Application application

The context of the application that is protected by reCAPTCHA.

@NonNull String siteKey

An Android site key registered for the caller app at https://cloud.google.com/recaptcha-enterprise/docs/create-key

long timeout

Maximum amount of time to initialize the RecaptchaClient in milliseconds. Default value is 10 seconds.

Returns
@NonNull Result<@NonNull RecaptchaClient>

An instance of Result encapsulating a RecaptchaClient.

getTasksClient

public static final @NonNull Task<@NonNull RecaptchaTasksClientgetTasksClient(@NonNull Application application, @NonNull String siteKey)

Returns a Task of RecaptchaTasksClient associated with the siteKey to access all reCAPTCHA APIs.

The SDK currently supports one Site Key. Passing a different Site Key will throw an exception.

This method will throw a timeout exception after 10 seconds.

Parameters
@NonNull Application application

The context of the application that is protected by reCAPTCHA.

@NonNull String siteKey

An Android site key registered for the caller app at https://cloud.google.com/recaptcha-enterprise/docs/create-key

Returns
@NonNull Task<@NonNull RecaptchaTasksClient>

An instance of Task encapsulating a RecaptchaTasksClient.

getTasksClient

public static final @NonNull Task<@NonNull RecaptchaTasksClientgetTasksClient(
    @NonNull Application application,
    @NonNull String siteKey,
    long timeout
)

Returns a Task of RecaptchaTasksClient associated with the siteKey to access all reCAPTCHA APIs.

The SDK currently supports one Site Key. Passing a different Site Key will throw an exception.

At least a 10000 millisecond timeout is suggested to allow for slow networking, though in some cases longer timeouts may be necessary. The minimum allowable value is 5000 milliseconds.

Parameters
@NonNull Application application

The context of the application that is protected by reCAPTCHA.

@NonNull String siteKey

An Android site key registered for the caller app at https://cloud.google.com/recaptcha-enterprise/docs/create-key

long timeout

Maximum amount of time to initialize the RecaptchaClient in milliseconds. Default value is 10 seconds.

Returns
@NonNull Task<@NonNull RecaptchaTasksClient>

An instance of Task encapsulating a RecaptchaTasksClient.