简体   繁体   English

newMyFriendsRequest Facebook仅返回25个朋友

[英]newMyFriendsRequest Facebook returns only 25 friends

I am making a call to fb to retrieve friend list from android app. 我正在致电fb,以从android应用中检索朋友列表。 I have got a list of around 35 people on the app all who have given "user_friends" permission. 我在该应用程序上得到了大约35个人的列表,这些人均已授予“ user_friends”权限。 But I am not able to retrieve more than 25 friends whatever I do. 但是无论我做什么,我都无法找回超过25个朋友。

Following is my code: 以下是我的代码:

Session activeSession = Session.getActiveSession();
        if(activeSession.getState().isOpened()){
            Request friendRequest = Request.newMyFriendsRequest(activeSession, 
                new GraphUserListCallback(){
                    @Override
                    public void onCompleted(List<GraphUser> users,
                            Response response) {
                        mUsers = users;
                        if(mUsers==null)
                        {
                        return;
                        }


                    String[] userids = new String[mUsers.size()];

                    int i = 0;
                    for(GraphUser user : mUsers){
                    userids[i] = user.getId();
                    i++;
                    }
                  .... more code

What am I missing? 我想念什么?

You have to implement paging: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging 您必须实现分页: https : //developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

Alternatively, you can try adding a limit parameter to the API call: /me/friends?limit=50 或者,您可以尝试将限制参数添加到API调用: /me/friends?limit=50

I am no Android programmer, but i´ve found this in another thread, it may work: 我不是Android程序员,但我在另一个线程中找到了它,它可能会起作用:

Bundle params = new Bundle();
params.putString("limit", "50");
friendRequest.setParameters(params);

Source: Get friend list facebook 3.0 资料来源:交朋友清单facebook 3.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM