-1

当我生成具有范围的登录 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){
4

1 回答 1

0

尝试这个...

$loginUrl = $facebook->getLoginUrl(
    array(
        'redirect_uri' => $appurl,
        'scope' => 'email, user_about_me, user_events',
    )
);
于 2013-01-01T05:09:19.697 回答