2
我不斷收到:PHP SDK Facebook粉絲專頁後,未捕獲OAuthException:(#200)
「未捕獲OAuthException:(#200)的用戶沒有授權的應用程序來執行此操作」
require_once("resources/facebook_sdk/facebook.php");
$app_id = 'appid';
$app_secret = 'appsecret';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$user = $facebook->getUser();
if($user)
{
$access_token= $facebook->getAccessToken();
}
else {
$loginUrl = $facebook->getLoginUrl(array(
'canvas' => 1,
'fbconnect' => 0,
'scope' => 'offline_access,read_stream,user_photos,user_videos,publish_stream,manage_pages'
));
echo ("<script> top.location.href='".$loginUrl."'</script>");
}
$req = array(
'access_token' => $access_token,
'name' => 'My wall post',
'message' => 'tralalala',
'caption' => "www.mysite.com",
'link' => 'http://www.mysite.com',
'description' => 'Wall post',
'picture' => 'http://farm6.static.flickr.com/1111/some-pic.jpg',
'actions' => array(array('name' => 'My Site',
'link' => 'http://www.mysite.com'))
);
print_r($req);
$res = $facebook->api('/pageid/feed' ,'post',$req);
if ($res) echo "succes";
else echo "fail";
print_r($res);
任何想法我做錯了,發佈流權限給出?
@Phoenix_yay你能不能在範圍內編寫publish_stream並檢查將會做什麼? – 2013-02-18 14:14:40
@Phoenix_yay你可以解決這個問題或找到一些問題,我的回答可以幫助你嗎? – 2013-02-19 05:58:16
這是本地服務器問題,所以它解決了謝謝你。 – 2013-02-19 13:10:49