单击reCAPTCHA后,我在Android开发中被迫关闭麻烦。这是我在logcat中的响应错误代码:
12-03 16:04:32.573 2678-2995/com.google.android.gms.ui E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
12-03 16:04:32.652 2678-2995/com.google.android.gms.ui E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
12-03 16:04:32.704 2678-2995/com.google.android.gms.ui E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
12-03 16:04:32.732 2678-2995/com.google.android.gms.ui E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
12-03 16:04:32.772 2678-2995/com.google.android.gms.ui E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
这是我在Android上使用reCAPTCHA的代码
protected void handleSiteVerify(final String responseToken){
String url = "https://www.google.com/recaptcha/api/siteverify";
StringRequest request = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
if(jsonObject.getBoolean("success")){
Toast.makeText(getApplicationContext(),String.valueOf(jsonObject.getBoolean("success")),Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(getApplicationContext(),String.valueOf(jsonObject.getString("error-codes")),Toast.LENGTH_LONG).show();
}
} catch (Exception ex) {
Log.d(TAG, "JSON exception: " + ex.getMessage());
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(TAG, "Error message: " + error.getMessage());
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
params.put("secret", SECRET_KEY);
params.put("response", responseToken);
return params;4
}
};
request.setRetryPolicy(new DefaultRetryPolicy(
50000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
queue.add(request);
}
完成后,每次在Android上单击reCAPTCHA时,总是强制关闭。也许您对我的代码有个想法..请帮助我