Facebook应用程序不会弹出权限

时间:2014-07-06 19:31:06

标签: php facebook-php-sdk

一切都适用于测试用户但是当我发布我的应用程序并且用户点击应用程序时,不会出现权限弹出对话框。我想有一些oauth问题,但不确定。请帮帮我

require 'facebook-files/facebook.php';
$app_id='xxxxxxxxxx';
$secret='xxxxxxxxxxxxx';

$facebook = new Facebook(array(
  'appId'  => $app_id,
  'secret' => $secret,
  'cookie'=> true,
  'grant_type' => 'client_credentials'
));

// Get User ID
 $user = $facebook->getUser();

if ($user) {
  try {
      //$access_token = $facebook->getAccessToken();

    // Proceed knowing you have a logged in user who's authenticated.
        $user_profile = $facebook->api('/me');
        $friends = $facebook->api('/me/friends?fields=id,name,birthday,picture');
        $event = $facebook->api('/me/?fields=events.fields(id,name)');

    } catch (FacebookApiException $e) {

    echo "Exception".error_log($e);
    $user = null;
    exit;
  }
}
// Login or logout url will be needed depending on current user state.
if ($user) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl(array(
  'scope'  => 'read_stream,publish_actions,publish_stream,user_birthday,friends_birthday', 'display'=>'popup')
  );
}

1 个答案:

答案 0 :(得分:0)

确保将您的网站添加到"有效的oauth重定向uris"在您应用的设置中输入字段。