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.com/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!
FB.api('/me')Will give you the user’s id without requiring any special permissions.You can’t get address as such, you can get
locationusing theuser_locationpermission. Then you’ll be able to get it via the same/memethod.Facebook Developers doc:
https://developers.facebook.com/docs/reference/api/user/