我如何获得“朋友”列表?谁添加了我的 Facebook 应用程序?
我确实在努力解决一些应该很简单的事情:向我的 Facebook 应用程序的用户显示他们也使用该应用程序的朋友列表。 API 中是否没有内置任何内容来允许此类常见请求?
我唯一能想到要做的就是获取用户朋友的列表,然后从我的数据库中获取该列表中的所有用户,然后然后获取每个 Facebook ID 的信息。但这似乎是一种极其迂回的做事方式......
I'm really struggling with something that should be a simple matter: Showing a user of my Facebook app a list of their friends also using the app. Is there nothing built into the APIs to allow such a common request?
The only thing I can think of to do is to get the list of the user's friends, and then get all the users from my database who are in that list, and then fetch information for each of those facebook ids. But that seems an extremely roundabout way of doing things...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现执行此操作的唯一方法是使用 FQL 和以前记录但现在未记录的字段:
未记录的字段是 user.is_app_user,它列于 旧文档 wiki 但不在 闪亮的新文档。不知道这是否意味着它将来会被删除,但似乎没有任何其他方法可以使用新的 Graph API 获取这些数据。
如果您仍在使用旧的 REST API,您还可以调用 friends.getAppUsers 方法。
The only way I've found to do this is to use FQL and a previously documented, but now undocumented field:
The undocumented field is the user.is_app_user, which is listed in the old documentation wiki but not in the shiny new docs. No idea if this means it'll be removed in the future, but there doesn't seem to be any other way to get this data with the new Graph API.
Just in-case you're still using the old REST API, you can also call the friends.getAppUsers method.
实际上,您可以使用 Facebook 的旧 REST API 来执行此操作,方法是将 GET 请求发送到: https://api .facebook.com/method/friends.getAppUsers
如果您需要返回 JSON 数据,请添加参数
format=json
您需要一个访问令牌才能执行此操作。请参阅此处的文档:
http://developers.facebook.com/docs/reference/rest/friends。获取应用程序用户/
You can actually use Facebook's old REST API to do this by sending a GET request to: https://api.facebook.com/method/friends.getAppUsers
If you need JSON data back, then add the parameter
format=json
You need an access token to do this. See the documentation here:
http://developers.facebook.com/docs/reference/rest/friends.getAppUsers/