如何通过Facebook获取用户的朋友列表? [英] How to get a list of user's friends via 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屋!