0
我是新的facebook應用程序開發,我被卡在如何發佈到Facebook。 我讀過教程,並根據他們做。卡在張貼到臉書
下面是代碼:
<?php
require 'facebook.php';
// Create our Application instance (replace this with your appId and secret).
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
'cookie' => true,
));
//Request params
if(!($_GET['code'])) {
header("Location:https://www.facebook.com/dialog/oauth?client_id=xxx&redirect_uri=" . urlencode("http://localhost/facebook/examples/") . "&scope=publish_stream");
//header("Location:http://www.google.com");
exit;
}
$token = $_GET['code'];
echo "token " . $token
$status = $facebook->api('/me/feed', 'POST', array('message' => 'This post came from my app.', 'access_token' => $token));
var_dump($status);
?>
結果:
致命錯誤:未捕獲OAuthException:用C拋出爲簽名:\瓦帕\ WWW \實\例子\ facebook.php上線543
我錯過了什麼嗎?