I have the follwing code and would like to take the email address and other details of facebook user. This is the code that I have done.
FB.login(function(response) {
if (response.authResponse) {
//updateUserInfo(fb_id);
console.log(response.authResponse);
updateUserInfo(response.authResponse.userID);
$.ajax({
dataType: "json",
url: 'http://graph.facebook.com/'+response.authResponse.userID+'/ fields=id,name,birthday,email,gender,hometown,location',
success: function(data){
fb_data = data;
console.log(data);
}});
},{scope:'email'});
I am unable to get get the following details:
- birthday
- Location
- hometown
However, I am able to get the first name and id.
If I am supposed to use the access token, how am i supposed to put it in the query? The email address is the vital information as my system identifies user by email address.