I'm using Google recaptcha api to implement captcha on login action in my app. But every time I try to initialise the recaptcha api to get the recaptcha tasks client then It's giving either INTERNAL_ERROR or Timed out waiting for 10000 ms
I'm calling initiateSDK inside onCreate() of Application activity
Please let me know what's the reason for these errors and solution to fix.
In iOS, we are using same approach.
Code Snippet
public void initiateSDK(Context context) {
if (recaptchaTasksClient == null) {
init(context);
}
}
private void init(Context context) {
new Handler().post(() -> Recaptcha.getTasksClient((Application) context.getApplicationContext(), BuildConfig.RECAPTCHA_API_KEY)
.addOnSuccessListener(client -> {
recaptchaTasksClient = client;
})
.addOnFailureListener(e -> {
e.printStackTrace();
Log.d("RECAPTCHA", e.getMessage());
}));
}