我沒有使用FBML和PHP SDK一段時間,我只是可以得到wallpost工作了?去年我的代碼工作的很好,但現在它不會工作......所以我的應用程序可以再次wallpost?幫助:)Facebook應用程序:如何發佈wallpost
舊代碼:
<?php
require_once('fb/src/facebook.php');
$config = array(
'appId' => '******',
'secret' => '***********',
);
$facebook = new Facebook($config);
$user_id = $facebook->getUser();
$tiedosto = file("http://mydomain.com/doh.txt");
$sids = $tiedosto[$total];
$tiditii = "What's here:";
$message = "";
$text = "Checkout!";
$attachment = array('name' => "$tiditii", 'href' => 'http://mydomain.com/do',
'description' => "$sids
", 'media' => array(array('type' => 'image', 'src' => 'http://mydomain.com/pic.gif',
'href' => 'http://mydomain.com/do')));
?>
<script>
function callback_function(){document.setLocation("http://apps.facebook.com/myapp");};
function publishPost() {
var msg = <?= json_encode($message) ?>;
var attachment = <?= json_encode($attachment) ?>;
Facebook.streamPublish(msg, attachment);
}
</script><p>
<input name="Next" type="button" id="button" class="appMY_APP_ID_button" value="Publish" onclick="publishPost(); return false;"/>
你會得到什麼迴應?你怎麼知道它不工作?什麼都沒發生?錯誤信息? – ThdK 2012-03-05 13:21:07
我收到錯誤消息:從myapp加載頁面時出錯 收到空響應。 – WKoA 2012-03-05 14:20:20