Answer the question
In order to leave comments, you need to log in
How to login to the site through Facebook?
Using Javascript FB SDK I get status='connected'
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'app-id',
cookie : true,
xfbml : true,
version : 'v2.12'
});
FB.AppEvents.logPageView();
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function facebook_login(){
FB.login(function(response) {
if (response.status === 'connected')
{
var userID=response.authResponse.userID
FB.api('/'+userID+'?fields=id,name,email,birthday,gender,picture', function(userinfo)
{
console.log(userinfo.email)
});
}
else
{}
})
}
</script>
Answer the question
In order to leave comments, you need to log in
I found a solution:
return the email on the backend via:
https://graph.facebook.com/me?fields=email&access_token={{token}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question