This is the code I'm using to get information from Facebook:
$fbUsrId = $facebook->getUser();
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => 'email'
)
);
if ($fbUsrId) {
$fbUsr = $facebook->api('/me');
var_dump($fbUsr);
}
If I test in live it works fine, but from localhost Facebook returns only the user's name and email:
array (size=2)
'name' => string 'xxx xxx' (length=18)
'id' => string 'xxx' (length=15)
There may be two things here:
email
permission.?fields=field1,field2
syntax to declare all the fields you want the API to return. Which means you have to specify the fields explicitly like /v2.4/me?fields=name,email
etc.