newMyFriendsRequest的Facebook只返回25位朋友 [英] newMyFriendsRequest Facebook returns only 25 friends
本文介绍了newMyFriendsRequest的Facebook只返回25位朋友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我打电话到FB检索Android应用程序的好友列表。我有大约35人在App所有谁给了user_friends权限列表。
但我不能够检索超过25个朋友无论我做什么。
I am making a call to fb to retrieve friend list from android app. I have got a list of around 35 people on the app all who have given "user_friends" permission. But I am not able to retrieve more than 25 friends whatever I do.
以下是我的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
我是什么失踪?
推荐答案
您必须实现分页:的 https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging
另外,你可以尝试添加一个极限参数给API调用:<?code> / ME /朋友上限= 50
Alternatively, you can try adding a limit parameter to the API call: /me/friends?limit=50
我不是Android的程序员,但从来就发现了这个在另一个线程,它可能工作:
I am no Android programmer, but i´ve found this in another thread, it may work:
Bundle params = new Bundle();
params.putString("limit", "50");
friendRequest.setParameters(params);
这篇关于newMyFriendsRequest的Facebook只返回25位朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文