0
以下代碼已成功使用了幾個月。但最近它停止了工作。目標是從Facebook頁面中提取最新的Feed。現在的響應是「請求此資源需要訪問令牌」。但閱讀JS SDK文檔從來不會爲此方法提供任何更多的應用程序ID。這裏真正的錯誤是什麼?FB異步源認證失敗
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '<?php echo $this->appId; ?>', status: true, cookie: true, xfbml: true});
FB.api('/<?php echo $this->appId; ?>/feed', {'limit': <?php echo (int)$this->feedLimit; ?>}, function(response) {
if(response.data[0]) {
jQuery('.facebook .comment p a').append(response.data[0].message);
}
});
};
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());