【发布时间】:2023-03-15 06:04:01
【问题描述】:
我正在尝试获取登录到我的应用程序的用户的所有朋友。
我无法使用此 API [朋友]:
https://developers.facebook.com/docs/graph-api/reference/v2.0/user/friends
因为这个 API 只返回任何使用过发出请求的应用的朋友。
所以我找到了这个 API [friendlist]:
https://developers.facebook.com/docs/graph-api/reference/v2.0/friendlist
Followed this answer,我得到了好友列表。
但我在尝试获取好友列表的成员时得到了空列表:
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 是我的Acquaintances list id,我尝试了几个其他 id 的结果相同。
【问题讨论】:
-
你应该阅读developers.facebook.com/docs/graph-api/reference/v2.0/…。顶部有一个很大的警告,说它不存在 v2.0。 v2.0无法全部好友
-
警告涉及 API v1。无论如何,还有什么选择?
-
这取决于你想做什么。我们添加了 taggable_friends、invitable_friends 和社交上下文 API。因此,如果您想做这些 API 提供的功能,那么您应该使用它们。如果您想做其他需要所有朋友都做不到的事情
-
登录API变更申请:change.org/petitions/…
-
@WizKid 如果 /{friend-list-id}/members 不会返回任何数据,为什么它仍然可用,为什么没有明确指定这个东西?人们会浪费大量时间试图让它发挥作用。
标签: android facebook facebook-graph-api-v2.0 facebook-friends