0

I am trying to make web application and login with Facebook using its java script SDK but i am stuck on this problem API call:

FB.api('/me', function(response) {
    console.log(JSON.stringify(response));
});

This API call just give two inforamtion {"name":"Name","id":"74.......91"}

How to get full public profile information plus email address

Thanks

andyrandy
  • 72,880
  • 8
  • 113
  • 130
Parth Savadiya
  • 1,203
  • 3
  • 18
  • 40

1 Answers1

1
FB.api('/me', {fields: 'name,email,...'}, function(response) {
    console.log(JSON.stringify(response));
});

It is called "Declarative Fields", you need to specify the fields you want to get.

Changelog: https://developers.facebook.com/docs/apps/changelog#v2_4

Of course you need to ask for the email permission in the authorization process too.

andyrandy
  • 72,880
  • 8
  • 113
  • 130