自上周四 (28-11-2012) 以来,我的 Facebook 页面选项卡无法正常工作。在developers.facebook.com 中,我设置了“Facebook 上的应用”和“页面标签”。
来源:
$app_id = "XXXXXXXXXXXXXXX";
//$canvas_page = "https://facebook.com/my_facebook_page?sk=app_XXXXXXXXXXXXXXX";
$canvas_page = "http://my-promotion.domain.com";
$application_secret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $application_secret,
'cookie' => true,
));
$auth_url = "https://www.facebook.com/dialog/oauth?client_id=".$app_id."&redirect_uri=".urlencode($canvas_page)."&scope=user_likes,publish_actions";
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
1.如果我将 $canvas_page 设置为https://facebook.com/my_facebook_page?sk=app_XXXXXXXXXXXXXXX当我单击页面选项卡(在 Facebook 页面上)时会收到错误消息:
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: De opgegeven URL wordt niet toegestaan door de configuratie van de applicatie.
2.如果我将 $canvas_page 设置为 Canvas URL(在我的开发者.facebook.com 上的应用程序中声明) - http://my-promotion.domain.com/ - 我将获得身份验证对话框。但在给予许可后,我得到一个无限循环,如:
=">http://my-promotion.domain.com/?code=AQC_wreWvGJuZQC07I5Kyps79JIeuRv718wWoWYb94A_RlxagWWRQOBQp0xQUAjG6rWAHDrVWEo851udcTC9jWHor980h2ipQ67LLKgYEfvKN71bjMO3y9SzHjiGtpIiCZHd3L6gHgM3Vmzpw3NvpMxXCXIUQtYOsEeOJAOws5rY3IaTCMo5Al-cO5zFPd2K0sHnbXbDo2JAyYTNm5skW-0i# = (the value of ?code changes continuous)
在 28-11-2012 之前,如果我像选项 1 一样设置 $canvas_page,我的页面选项卡一直在工作。