如何获得所有用户朋友的列表? [英] how to get a list of all user friends?

查看:145
本文介绍了如何获得所有用户朋友的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Facebook Graph API v.20建立应用程式

I am building an app using Facebook Graph API v.20.

第一件事是将完整的用户的朋友列表( ID,名称和图片)到CSV文件。

The first thing it needs to do is to export the complete list of friends from the user (ID, name and picture) to a CSV file.

这是否可能?

推荐答案

短回答​​:不。



Graph API v2.0参考文件表示您的应用程式只会能够访问(通过API)至少自己使用您的应用的用户的朋友访问自己的朋友列表:

Short answer: No.

The Graph API v2.0 reference documentation implies that your app will only be able to access (through the API, at least) those of the user's friends who have themselves used your app and allowed your app to access their own friends list:


权限


  • A user access token with user_friends permission is required to view the current person's friends.

这将只会传回任何朋友,他们必须拥有 user_friends

This will only return any friends who have used (via Facebook Login) the app making the request.

如果某人的朋友拒绝了 user_friends 权限,该朋友不会显示在此人的朋友列表中。

If a friend of the person declines the user_friends permission, that friend will not show up in the friend list for this person.


$ b b

@ user664833在下面的评论中指出了对政策的一些澄清:

@user664833 pointed out some clarifications to the policy in the comment below:


有效2014年4月30日 for Facebook's API v2.0:(1)朋友列表不再是默认权限集的一部分,并且拥有自己的权限:请求访问某人的朋友列表现在是一个单独的权限您的应用程式必须要求。新的权限称为user_friends。 (2)朋友列表现在只返回还使用您的应用的朋友:通过/ me / friends端点返回的朋友列表现在仅限于已授权您的应用的朋友列表。 developers.facebook.com/docs/apps/changelog - FB用户可以访问的URL作为开发人员 - user664833六月10在5:50

Effective April 30th, 2014 for Facebook's API v2.0: (1) Friend list is no longer part of the default permission set and has its own permission: Asking for access to a person's friend list is now a separate permission that your app must request. The new permission is called user_friends. (2) Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app. developers.facebook.com/docs/apps/changelog -- URL accessible by FB users registered as developers – user664833 Jun 10 at 5:50

实际上,URL似乎是公开的,因为我可以查看它, 。< / p>< / p>< / b>

Actually, the URL seems to be public, since I can view it while not logged in. The changelog also explains why some apps can still view all friends, as @SimonCross pointed out:


对于2014年4月30日之前存在的应用,在不指定版本号(unversioned)的情况下进行API调用相当于调用API的v1.0。

For apps that existed before April 30th 2014, making an API call without specifying a version number ('unversioned') is equivalent to making a call to the v1.0 of the API.

对于在2014年4月30日当天或之后创建的应用程序,在不指定版本号的情况下进行API调用相当于调用API的v2.0。

For apps created on or after April 30th 2014, making an API call without a specifing a version number is equivalent to making a call to v2.0 of the API.

无效或在2014年4月30日当天或之后拥有创建日期的应用将无法拨打v1.0的API。必须使用v2.0。

Apps that were inactive or have a creation date on or after April 30th, 2014 will not be able to make calls to v1.0 of the API. They must use v2.0.

这篇关于如何获得所有用户朋友的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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