简体   繁体   中英

facebook javascript api get user email

I am trying to fetch facebook user email for my app. But when i query the email address is returned as null. Forums suggest that the user should grant the email permission to your app. How to make user grant that permission or ask him what fields will he give access to the application. I am able to get name but not email from the code below.

 FB.api(
    {
      method: 'fql.query',
      query: 'SELECT name, email FROM user WHERE uid='+FB.getSession().uid
    },
    function(response) {
          alert(response[0].name);

    }
  );

its prettry simple my dear just take permission at the time of login.

<fb:login-button perms="email" autologoutlink="true"></fb:login-button>

and take other permissions in perms with comma seperated values. I hope it will help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM