[英]Facebook Graph API - Get profile picture prior to authenticating
Ok so i've tried the following: 好的,所以我尝试了以下操作:
FB.api("/me", {fields: "picture"}, function(response){
console.log(response);
});
And i'm trying to work around http://graph.facebook.com/USERNAME_OR_USERID/picture
since obviously i don't know the users ID prior to authenticating. 我正在尝试解决
http://graph.facebook.com/USERNAME_OR_USERID/picture
因为显然我在身份验证之前不知道用户ID。 All i want is a "modern" feel within the website, so i'd like to present the user with his or her's profile picture on the "login" div presenting the facebook login button. 我想要的只是网站上的一种“现代”感觉,因此我想在呈现Facebook登录按钮的“登录” div上向用户展示他或她的个人资料图片。 Is this possible?
这可能吗? I know that Facebook and their graph api prohibits most such features but i would hope that a public profile picture would be accessible through the graph API..
我知道Facebook及其图API禁止大多数此类功能,但我希望可以通过图API访问公共资料图片。
I've Googled around and all the solutions say "use the USERNAME in the URL and you're fine" but i'm not, so to clear out any doubts, is this possible? 我已经在Google周围搜索了,所有解决方案都说“使用URL中的USERNAME,您就可以了”,但我不是,因此,为了消除任何疑问,这可能吗?
Error message: An active access token must be used to query information about the current user.
错误消息:
An active access token must be used to query information about the current user.
You can get everyone's Facebook profile picture without authentication. 您无需身份验证即可获取所有人的Facebook个人资料照片。
You just call http://graph.facebook.com/USERNAME_OR_USERID/picture?type=large . 您只需致电http://graph.facebook.com/USERNAME_OR_USERID/picture?type=large即可 。 This URL redirects you to image URL.
此URL将您重定向到图像URL。
Type may be normal,small or large. 类型可以是普通的,大小的。
I also have questions for you: 我也有问题要问你:
It looks like you want to know whose Facebook account was lastly connected on the browser of your visitor. 您似乎想知道访问者的浏览器上最近连接了谁的Facebook帐户。 Technically, you would want to read another site's cookies, which is 1) not allowed 2) impossible .
从技术上讲,您可能想读取另一个站点的cookie,这是1)不允许2)不可能 。
Several additional things you need to know: 您需要了解的其他几件事:
http://graph.facebook.com/USERNAME_OR_USERID/picture
is a public way to retrieve someone's photo. http://graph.facebook.com/USERNAME_OR_USERID/picture
是一种检索某人照片的公共方法。 You don't need a token for that. FB.API("/me", ...)
from the JS SDK implies that "me"
represents the connected user. FB.API("/me", ...)
意味着"me"
代表连接的用户。 It cannot just be used alone. By the way, identical questions have already been answered and accepted : 顺便说一句,相同的问题已经得到回答和接受 :
Why would you hope the impossible? 你为什么希望不可能呢?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.