当我使用范围生成一个登录URL时,getUser()返回0; 没有getLoginUrl()中的参数;它返回一个用户ID。
$userID = $facebook->getUser();
$params = array();
$params['scope'] = 'email, user_about_me, user_events';
$params['redirect_uri'] = $appurl;
$loginUrl = $facebook->getLoginUrl($params); // doesnt work
//$loginUrl = $facebook->getLoginUrl(); // works
$logoutUrl = $facebook->getLogoutUrl();
//test user
if($userID){
答案 0 :(得分:0)
试试这个......
$loginUrl = $facebook->getLoginUrl(
array(
'redirect_uri' => $appurl,
'scope' => 'email, user_about_me, user_events',
)
);