在这里,我试图在我的应用程序中获取带有 facebook 详细信息的用户登录 ID,并且在下面的代码中,我得到“facebook 无法解析或不是字段错误
try {
// PROFILE DETAILS AND FRIENDS COUNTER
String queryUserInfo = "SELECT uid FROM user WHERE uid = me()";
Bundle paramUserInfo = new Bundle();
paramUserInfo.putString("method", "fql.query");
paramUserInfo.putString("query", queryUserInfo);
String responseUserInfo = Util.facebook.request(paramUserInfo);
//"facebook cannot be resolved or is not a field " error in getting facebook userid.
JSONArray JAUserData = new JSONArray(responseUserInfo);
for (int i = 0; i < JAUserData.length(); i++) {
JSONObject JOUserData = JAUserData.getJSONObject(i);
if (JOUserData.has("uid")) {
String getUserID = JOUserData.getString("uid");
}
}
} catch (Exception e) {
e.printStackTrace();
}