让所有用户朋友使用Facebook图形API - 机器人 [英] Get ALL User Friends Using Facebook Graph API - Android

查看:312
本文介绍了让所有用户朋友使用Facebook图形API - 机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想是登录到我的应用程序的用户让所有的朋友。

I'm trying to get all friends, of a user that logged into my application.

我不能使用这个API [网友]:

I can't use this API [friends]:

<一个href="https://developers.facebook.com/docs/graph-api/reference/v2.0/user/friends">https://developers.facebook.com/docs/graph-api/reference/v2.0/user/friends

由于此API只返回谁使用发出请求的应用程序的任何朋友。

Because this API only returns any friends who have used the app making the request.

所以,我发现这个API [好友列表]:

So I found this API [friendlist]:

<一个href="https://developers.facebook.com/docs/graph-api/reference/v2.0/friendlist">https://developers.facebook.com/docs/graph-api/reference/v2.0/friendlist

<一个href="http://stackoverflow.com/questions/11850341/is-it-possible-to-access-a-users-groups-of-friends-on-facebook-using-facebook-gr">Followed这个答案,我得到了好友列表清单。

Followed this answer, I got the friendlist list.

但我发现了空单试图获取好友列表的成员时:

But I'm getting empty list when trying to get friendlist's members:

new Request(
            session,
            "/2692926356774/members",
            null,
            HttpMethod.GET,
            new Request.Callback()
            {
                public void onCompleted(Response response)
                {
                    /* handle the result */
                    Log.e(LOG_TAG,"Members: " + response.toString());
                }
            }
    ).executeAsync();

2692926356774 是我的熟人列表ID ,我试过一些其他的ID具有相同的结果。

2692926356774 is my Acquaintances list id, I tried few other id's with the same result.

推荐答案

在图形API的2.0版,叫 / ME /朋友返回此人的朋友谁也使用应用程序。

In v2.0 of the Graph API, calling /me/friends returns the person's friends who also use the app.

此外,在2.0版中,您必须请求 user_friends 许可从每个用户。 user_friends 不再默认包含在每次登录。每个用户必须授予 user_friends 权限才能出现在/我的回应 /朋友。请参见 Facebook的升级指南更详细的信息,或查看下面的总结。

In addition, in v2.0, you must request the user_friends permission from each user. user_friends is no longer included by default in every login. Each user must grant the user_friends permission in order to appear in the response to /me/friends. See the Facebook upgrade guide for more detailed information, or review the summary below.

/ ME /好友列表终端和 user_friendlists 的权限是不是你追求的是什么。此端点不返回用户的朋友 - 它可以让你访问列表中的人作出了安排他们的朋友。它不返回的朋友在这些名单中。这个API和权限是非常有用的,让你给人当机会来发布回Facebook的呈现自定义隐私选择。

The /me/friendlists endpoint and user_friendlists permission are not what you're after. This endpoint does not return the users friends - its lets you access the lists a person has made to organize their friends. It does not return the friends in each of these lists. This API and permission is useful to allow you to render a custom privacy selector when giving people the opportunity to publish back to Facebook.

如果您要访问非应用程序,使用好友列表,有两种选择:

If you want to access a list of non-app-using friends, there are two options:

  1. 如果你想要让你的人民标记自己朋友 ,因为它们使用的应用程序发布到Facebook的故事,你可以使用 / ME / taggable_friends API。 使用此终端,需要审查的Facebook 并应仅用于在那里你正在渲染,以让用户在一个标记后他们的朋友名单的情况。

  1. If you want to let your people tag their friends in stories that they publish to Facebook using your App, you can use the /me/taggable_friends API. Use of this endpoint requires review by Facebook and should only be used for the case where you're rendering a list of friends in order to let the user tag them in a post.

如果你的应用程序是一个游戏,您的游戏支持Facebook的帆布 ,您可以使用 / ME / invitable_friends 终点,以渲染的自定义邀请对话框,然后通过这个API来的the标准请求对话框。

If your App is a Game AND your Game supports Facebook Canvas, you can use the /me/invitable_friends endpoint in order to render a custom invite dialog, then pass the tokens returned by this API to the standard Requests Dialog.

在其他情况下,应用程序将不再能够检索用户的好友(仅限谁已使用 user_friends 权限特别授权您的应用程序的那些朋友)的完整列表。

In other cases, apps are no longer able to retrieve the full list of a user's friends (only those friends who have specifically authorized your app using the user_friends permission).

有关应用程序想要让人们邀请好友使用的应用程序,你仍然可以使用发送对话框上网络或新消息对话框在iOS 和的Android

For apps wanting allow people to invite friends to use an app, you can still use the Send Dialog on Web or the new Message Dialog on iOS and Android.

这篇关于让所有用户朋友使用Facebook图形API - 机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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