如何通过Facebook获取用户的朋友列表? [英] How to get a list of user's friends via facebook?

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

问题描述

说我要让用户使用Facebook登录到我的网站,如下所示:

  http: //www.facebook.com/dialog/oauth?client_id=$appId& 
redirect_uri = $ return& scope = user_birthday,email,user_location

有没有办法为了让我得到所有用户的朋友列表和显示图片(如果可用)?可以使用哪种图形API函数来执行此操作?

解决方案

您必须对



示例在这里: http://developers.facebook.com/docs/reference/api/



一旦你有用户ID - 你可以把你的< img src =/> 指向 http:// graph.facebook.com/<user_id>/picture url。


Say I was to let a user login to my website using facebook, by something like the following url:

http://www.facebook.com/dialog/oauth?client_id=$appId&
redirect_uri=$return&scope=user_birthday,email,user_location

Would there be a way for me to get a list of all the user's friends and display pictures (where available)? Which graph API function could I use to do this?

解决方案

You have to perform a query to the https://graph.facebook.com/me/friends

Sample is here: http://developers.facebook.com/docs/reference/api/

And as soon as you have user id - you can point your <img src="" /> to the http://graph.facebook.com/<user_id>/picture url.

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

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