admin管理员组文章数量:1406177
I am able to get the name and email like this:
FB.api('/me', function(response)
{
alert ("Name when logged in:" + response.name);
alert ("Name when logged in:" + response.email);
});
But in the FB documentation, I don't see how to get address. Also, how can I download their photo?
As I understand it, their photo can be retrieved from this url:
But how do I get their facebook user id?
Also, to get the address, I am trying something like this:
alert ("Location:" + response.location);
alert ("Location:" + response.location.city);
alert ("Location:" + response.location.country);
alert ("Location:" + response.location.zip);
alert ("Location:" + response.location.state);
But that doesn't work. Anyone know how to get at these fields? Thanks!
I am able to get the name and email like this:
FB.api('/me', function(response)
{
alert ("Name when logged in:" + response.name);
alert ("Name when logged in:" + response.email);
});
But in the FB documentation, I don't see how to get address. Also, how can I download their photo?
As I understand it, their photo can be retrieved from this url: http://graph.facebook./FACEBOOK_USER_ID/picture
But how do I get their facebook user id?
Also, to get the address, I am trying something like this:
alert ("Location:" + response.location);
alert ("Location:" + response.location.city);
alert ("Location:" + response.location.country);
alert ("Location:" + response.location.zip);
alert ("Location:" + response.location.state);
But that doesn't work. Anyone know how to get at these fields? Thanks!
Share Improve this question edited Aug 3, 2011 at 13:53 Genadinik asked Aug 3, 2011 at 13:07 GenadinikGenadinik 18.6k64 gold badges191 silver badges288 bronze badges 5- 2 You do realize that sounds very creepy. – Joseph Marikle Commented Aug 3, 2011 at 13:09
- 2 @Joseph its very mon. The user gives permissions to do this first. – Genadinik Commented Aug 3, 2011 at 13:17
- If this is to create one of those annoying 'See your top firends' type app then I vote no one helps him :P – Rob Quincey Commented Aug 3, 2011 at 13:17
- @Genadinik I see. Perfectly valid I suppose... but now I know why I never got into FB :P – Joseph Marikle Commented Aug 3, 2011 at 13:20
- @Joseph if you think about it, it is the same info as you would give when creating an account on many other sites. – Genadinik Commented Aug 3, 2011 at 13:24
2 Answers
Reset to default 3FB.api('/me')
Will give you the user's id without requiring any special permissions.
You can't get address as such, you can get location
using the user_location
permission. Then you'll be able to get it via the same /me
method.
Facebook Developers doc:
https://developers.facebook./docs/reference/api/user/
Actually all that info is here: http://developers.facebook./docs/reference/api/user/
But it took a long time to find that page!
本文标签: How to get person39s address using Facebook Javascript SDKStack Overflow
版权声明:本文标题:How to get person's address using Facebook Javascript SDK? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744972286a2635306.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论