我有一个基于此身份验证代码的非常简单的 Facebook 应用程序:
$session = $facebook->getUser();
if (!$session) {
$url = $facebook->getLoginUrl(array(
'canvas' => 1,
'fbconnect' => 0,
'scope' => 'publish_stream, email, user_activities, user_birthday, user_hometown'
//'req_perms' => 'publish_stream,email,user_location,user_birthday,user_hometown'
));
echo "<script type='text/javascript'>top.location.href = 'FB_URL';</script>";
} else {
try {
$uid = $facebook->getUser();
$me = $facebook->api('/me');
} catch (FacebookApiException $e) {
echo "<script type='text/javascript'>top.location.href = 'FB_URL';</script>";
exit;
}
}
echo "\n === \n";
print_r($uid);
echo "\n === \n";
print_r($me);
输出是:
=== ID_VALUE === Array ( [id] => ID_VALUE [name] => NAME [first_name] => FIRST_NAME [last_name] => LAST_NAME [link] => PROFILE_URL [username] => USERNAME [gender] => male [email] => EMAIL [timezone] => 2 [locale] => en_US [verified] => 1 [updated_time] => 2012-05-16T13:00:04+0000 )
我希望在指定扩展权限后user_birthday
,user_hometown
我还应该在数组中获取有关用户生日和家乡的信息……但不幸的是,这些信息在那里丢失了……
我错过了什么或者我做错了什么?