我正在开发一款Android应用程序,希望能获取用户的好友列表。根据Facebook Api V2.0的规定,我只能获得已经通过我的应用程序登录过的用户好友列表。然而,尽管我知道某些用户的某些好友已经通过我的应用程序登录过,但当请求该用户的好友时,这些好友不会出现在Facebook请求响应中。例如,我只能得到40个好友而不是50+。
有人遇到过这种情况吗?我已经删除了几个用户的应用程序并重新授权登录,但行为没有任何改变。
以下是我使用的代码:
有人遇到过这种情况吗?我已经删除了几个用户的应用程序并重新授权登录,但行为没有任何改变。
以下是我使用的代码:
new Request(ParseFacebookUtils.getSession(),"me/friends", null, null, new Request.Callback(){
@Override
public void onCompleted(Response response) {
if (response == null){
return;
}
else if (response.getError() != null){
response.getError().getException().printStackTrace();
return;
}
GraphMultiResult result = response.getGraphObjectAs(GraphMultiResult.class);
List<GraphObject> fbInList = result.getData();
if (fbInList != null && !fbInList.isEmpty()){
for (GraphObject user : fbInList) {
JSONObject jsonUser = user.getInnerJSONObject(); // The Facebook User
System.out.println("name: " + jsonUser.optString("name"));
}
}
}
}).executeAsync();