How do i get someones profile picture to display back to them?

霸气de小男生 提交于 2020-01-23 11:41:36

问题


How do i get someones profile picture to diplay back to me. I have already gotten permissions to use the user's pictures etc i just don't know how to use their profile picture and display it back to them.

Any help would be awesome


回答1:


Calling on the Graph API

http://graph.facebook.com/[id]/picture

The following will give you different sizes

http://graph.facebook.com/[id]/picture?type=square

http://graph.facebook.com/[id]/picture?type=normal

http://graph.facebook.com/[id]/picture?type=large

So you can just put these URLs straight in an <img> tag

EG: <img src="http://graph.facebook.com/4/picture?type=square" />

See: http://developers.facebook.com/docs/reference/api/#pictures

These are in the public domain, so there is no need for any authentication.



来源:https://stackoverflow.com/questions/7882570/how-do-i-get-someones-profile-picture-to-display-back-to-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!