我正在尝试使用下面的代码获取好友列表
GraphRequest request = GraphRequest.newMyFriendsRequest(
token,
new GraphRequest.GraphJSONArrayCallback() {
@Override
public void onCompleted(JSONArray array, GraphResponse response) {
// Insert your code here
}
});
request.executeAsync();
}
代码执行后返回的响应是
{Response: responseCode: 200, graphObject: {"data":[],"summary":{"total_count":461}}, error: null}
在登录时授予access friends
和public profile
的权限。
我如何获取我的朋友列表和他们的公共电子邮件/ Facebook电子邮件?
答案 0 :(得分:3)
您只会收到同时使用您的应用的朋友,请参阅
/me/friends
会返回正在使用您的应用的用户的朋友 在v2.0中,朋友API端点返回正在使用您的应用的朋友的列表。在v1.0中,回复包括了所有人的朋友。
而且,没有,如果您想问,则没有解决方法。
答案 1 :(得分:2)
您可以使用graph-api调用
来回复朋友列表/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
但限制是
。 https://developers.facebook.com/docs/graph-api/reference/v2.5/user/friends