-1

How to retrieve user mail id(using Fb javascript sdk) who is logged into fb , I did refer here but still i get result as undefined and here is my code :

    FB.getLoginStatus(function(response) 
    if (response.status === 'connected') {
    FB.api('/me', function(response) {

                 alert('Your mail is ' + response.email);


                },{scope:'email'});}
);

Please let me know where i am wrong ?

Community
  • 1
  • 1
Rangesh
  • 728
  • 2
  • 12
  • 27

1 Answers1

2

You cannot retrieve the email unless you have the permission to do so. You'll firstly need to request extended permissions.