AI-generated Key Takeaways
-
The reCAPTCHA API helps protect your app from spam and abuse by providing access to Google Cloud services, with more information available on reCAPTCHA Enterprise.
-
To create a reCAPTCHA client, use either
getClient(Context)
orgetClient(Activity)
, choosing the latter for better performance when working within a foreground Activity. -
getClient(Activity)
is recommended for making multiple API calls from an active Activity, whilegetClient(Context)
is used when there's no foreground Activity.
The reCAPTCHA API provides access to Google Cloud services that help you protect your app from spam and other abusive actions. For more information, see reCAPTCHA Enterprise
To instantiate a reCAPTCHA mobile client, call
getClient(Context)
or
getClient(Activity)
.
Public Method Summary
static RecaptchaClient |
getClient(Activity
activity)
Returns a
RecaptchaClient
that is used to access all APIs that are called when the app has a foreground
Activity .
|
static RecaptchaClient |
getClient(Context
context)
Returns a
RecaptchaClient
that is used to access all APIs that are called without access to a foreground
Activity .
|
Inherited Method Summary
Public Methods
public static RecaptchaClient getClient (Activity activity)
Returns a RecaptchaClient
that is used to access all APIs that are called when the app has a foreground
Activity
.
Use this method over
getClient(Context)
to improve performance if you plan to make multiple API
calls from your application's foreground Activity
.
public static RecaptchaClient getClient (Context context)
Returns a RecaptchaClient
that is used to access all APIs that are called without access to a foreground
Activity
.