Api facebook does not return date of birth

2

I'm using facebook's api to login and get some user data like first name, last name etc.

 function apilogin() {
console.log('Welcome!  Fetching your information.... ');
FB.api('me/','GET',{fields:'first_name,last_name,email,birthday'}, function(response) {
  console.log('Successful login for: ' + response.first_name);
  document.getElementById('status').innerHTML =
    '<br>Nome: ' + response.first_name + '<br>Sobrenome: '+response.last_name + '<br>email: '+response.email+'<br>Data nascimento: '+response.birthday;
});


<div class="fb-login-button" data-max-rows="2" data-size="large" data-show-faces="false" data-auto-logout-link="false" scope="email,public_profile,user_birthday" onlogin='checkLoginState();' auth-type="rerequest">login com o facebook</div>

I have defined all the permissions and parameters needed, but it only returns the date when I created the application on facebook, I would like to know if any configuration is necessary in the application, or if it is a lack of a specific syntax at least.

    
asked by anonymous 17.12.2016 / 23:02

1 answer

2

The only information the Graph API provides without review is the public profile , the others need to undergo a review by Facebook, and if approved, the application will be allowed to get the other information requested - probably for that reason you are not getting the date of birth.

  

If your application requests this permission, Facebook will have to   analyze how your application uses it.

     

When submitting for analysis, be clear about the reason age_range   not be sufficient for your use case.

In test scenario it is possible for the app administrator to enter facebook accounts (users), such as test user .

Reference of the birthday. It is interesting to note that most integrations will only need the age_range that accompanies the public_profile permission.

    
18.12.2016 / 00:55