I am using JavaScript API to create my app for Facebook. The problem is, it\'s returning
email = undefined.
I don\'t know why? And if I use Facebo
In this code i have get user data form facebook and store into my database using ajax
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me?fields=email,name,first_name,last_name', function(response)
{
FB.api(
"/"+response.id+"/picture?height=100",
function (responses) {
//console.log(responses.data.url)
response['profile_pic']=responses.data.url;
$.ajax({
type:"POST",
url:''+'home/facebook_get_signup',
data:response,
success:function(res)
{
if(res=='success')
{
window.location='';
}
if(res=='exists')
{
window.location='';
}
}
});
}
)
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
// handle the response
}, {scope: 'email,user_likes'});