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:
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.
You need following permission from user to get the data from Facebook.
You can check this or this for other permissions and uses.
Then you will get the access token once user click on your Login button and authorize your App.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With