Facebook Email field return null (even if the “email” permission is set and accepted)

前端 未结 14 1212
孤街浪徒
孤街浪徒 2020-11-29 01:12

For some users in our application, the email field returns NULL even if the user has granted the email access to the app. When we check the scope parameter and the validity

14条回答
  •  甜味超标
    2020-11-29 01:57

    I have read previous responses but though some of them true like if the user has not email confirmed but a mobile phone number, many times this error happens for ignoring how to request the information using FB api graph. Let's say your login was successfully done, and you now have an access token and user id an so on but still, cannot see email and other fields you are interested in. Go ahead using this request after confirming login status as connected:

    FB.api(
      '/me',
      'GET',
      {"fields":"id,name,birthday,email,about,cover"},
      function(response) {
          // Insert your code here
      }
    );
    

    depends on permissions you requested you now will be able to catch further information according to your needs.

提交回复
热议问题