Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hCaptcha not showing challenge #14

Closed
Amitoj02 opened this issue Dec 30, 2021 · 3 comments
Closed

hCaptcha not showing challenge #14

Amitoj02 opened this issue Dec 30, 2021 · 3 comments

Comments

@Amitoj02
Copy link

When I tried to implement it keep buffering and never show the challenge

  • I have provided Internet permission
  • I have attempted all sizes
  • Using com.github.hcaptcha:hcaptcha-android-sdk:1.1.0
  • Using androidx.appcompat:appcompat:1.2.0

The code I'm using is

final String SITE_KEY = "site key here";
final HCaptchaConfig hconfig = HCaptchaConfig.builder()
        .siteKey(SITE_KEY)
        .apiEndpoint("https://js.hcaptcha.com/1/api.js")
        .size(HCaptchaSize.NORMAL)
        .loading(true)
        .build();


HCaptcha.getClient(MainActivity.this).verifyWithHCaptcha(hconfig) 
    .addOnSuccessListener(new OnSuccessListener<HCaptchaTokenResponse>() {
        @Override
        public void onSuccess(HCaptchaTokenResponse response) {
            String userResponseToken = response.getTokenResult();
            showMessage("Success! Token: " + userResponseToken );
        }
    })
    .addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(HCaptchaException e) {
            showMessage("Error: " + e.getMessage() );
        }
    });
@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Dec 30, 2021

@Amitoj02 maybe you observe some errors in logcat?

@e271828-
Copy link
Contributor

@Amitoj02 please try with one of the test sitekeys: https://docs.hcaptcha.com/#integration-testing-test-keys and if that works, double-check the sitekey entered.

@Amitoj02
Copy link
Author

Alright, so I tried to compile again and it actually worked magically . Maybe I missed something or it was temporary issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants