gpt4 book ai didi

android - Google reCaptcha 不会在真实设备上显示验证码挑战对话框

转载 作者:行者123 更新时间:2023-11-29 16:34:20 25 4
gpt4 key购买 nike

我正在尝试在此 guide 之后实现 google reCaptcha来自谷歌开发者网站。我的代码:

private fun onClick() {
SafetyNet.getClient(this).verifyWithRecaptcha(CAPTCHA_KEY)
.addOnSuccessListener(this) { response ->
if (!response.tokenResult.isEmpty()) {
verify(response.tokenResult)
}
}
.addOnFailureListener(this) { e ->
if (e is ApiException) {
Log.d("asd", "Error message: " + CommonStatusCodes.getStatusCodeString(e.statusCode))
} else {
Log.d("asd", "Unknown type of error: " + e.message)
}
}
}

在模拟器上它工作正常。当我单击按钮时,reCaptcha 会显示包含多张图片的对话框,用户应在其中选择所有包含汽车、发动机等的图片。

但是,在真实设备上。单击按钮后,我总是收到 onSuccess 回调,并且对话框从未显示。

也许有人知道我遇到了什么问题?

最佳答案

根据 documentation :

If reCAPTCHA is confident that this is a real user on a real device it will return a token with no challenge. Otherwise it will provide a visual/audio challenge to attest the humanness of the user before returning a token.

“无挑战”意味着没有 reCAPTCHA。引用你的真实设备,谷歌显然已经对你的人性感到满意,不需要进一步确认。

verifyWithRecaptcha() 按设计运行。

关于android - Google reCaptcha 不会在真实设备上显示验证码挑战对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52929963/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com