使用 facebook API 检索好友的完整列表 [英] retrieve full list of friends using facebook API

查看:33
本文介绍了使用 facebook API 检索好友的完整列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的 2.0 版本有一个分页功能,可以限制一次请求的好友数量,这不允许我一次检索所有好友,尽管有一个参数调用 'limit',它只能通过循环 'offset' 来完成' 直至最后.问题是每个用户有不同数量的朋友!

new 2.0 version has a paging that limit the numbers of friends at one request, which doesn't allow me to retrieve all friends at once although there's a parameter call 'limit', it can only be done by looping the 'offset' till the end. The problem is each user has different number of friends!

我已经找了几个小时了,但仍然没有解决方案..

I've been looking around for few hours but still don't have a solution..

推荐答案

如 Graph API v2.0 升级指南 (https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids)

As mentioned in the Graph API v2.0 upgrading guide (https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids)

/me/friends 返回用户的好友,他们也在使用你的应用v2.0,friends API 端点返回一个人的好友列表谁也在使用您的应用.在 v1.0 中,响应包括所有个人的朋友.

/me/friends returns the user's friends who are also using your app In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.

应用需要访问非应用好友的两个关键用例:标记和邀请.在 v2.0 中,我们添加了 Taggable Friends APIInvitable Friends API 来支持这些流程.

There are two key use cases where apps need access to non-app friends: tagging and inviting. In v2.0, we've added the Taggable Friends API and the Invitable Friends API to support these flows.

一个人使用 Facebook Login v2.0 登录后,调用/v1.0/me/friends 和/v2.0/me/friends` 都将导致 v2.0行为 - 两个调用都将返回该人的朋友集也可以使用该应用.

After a person has logged in with v2.0 of Facebook Login, calling /v1.0/me/friends and/v2.0/me/friends` will both result in the v2.0 behaviour - both calls will return the set of the person's friends who also use the app.

因此,在 v2.0 中,您将只能通过 /me/taggable_friends(https://developers.facebook.com/docs/graph-api/reference/v2.0/user/taggable_friends) 端点,只包含字段idnamepicture,并且只能在a之后使用Facebook 对您的应用的评价.

So, in v2.0 you'll only be able to get all friends via the /me/taggable_friends (https://developers.facebook.com/docs/graph-api/reference/v2.0/user/taggable_friends) endpoint, which only contains the fields id, name, picture, and only can be used after a review of your app by Facebook.

这篇关于使用 facebook API 检索好友的完整列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆