我们已经实施了facebook sdk 3.23.0来检索通过fb登录使用我们的应用程序的朋友,但我们只收到一些朋友,而不是所有使用我的应用程序并通过facebook登录的朋友,我们在代码或Facebook帐户设置中遇到任何技术故障我们都不知道,请告诉我这个问题的根本原因,
以下是检索朋友列表的代码,他们正在使用我们的应用
Request request = Request.newMyFriendsRequest(session,
new Request.GraphUserListCallback() {
@Override
public void onCompleted(List<GraphUser> users,
com.facebook.Response response) {
// If the response is successful
Log.d(TAG, "users::********* " + users);
// Log.d(TAG, "users.size:: "+users.size());
Log.i("INFO", response.toString());
ArrayList<FbUser> fbUserList = new ArrayList<FbUser>();
}
});
答案 0 :(得分:1)
**Try this maybe its help you change tag as your requierment **
new GraphRequest(
AccessToken.getCurrentAccessToken(),
// "/me/friends",
//"me/taggable_friends",
"me/invitable_friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
try {
JSONArray rawName = response.getJSONObject().getJSONArray("data");
Log.e(TAG,"Json Array Length "+rawName.length());
Log.e(TAG,"Json Array "+rawName.toString());
for (int i = 0; i < rawName.length(); i++) {
JSONObject c = rawName.getJSONObject(i);
String name = c.getString("name");
Log.e(TAG, "JSON NAME :"+name);
JSONObject phone = c.getJSONObject("picture");
Log.e(TAG,""+phone.getString("data"));
JSONObject jsonObject = phone.getJSONObject("data");
String url = jsonObject.getString("url").toString();
Log.e(TAG,"@@@@"+jsonObject.getString("url").toString());
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
).executeAsync();