【问题标题】:Publish to wall with Facebook API使用 Facebook API 发布到墙上
【发布时间】:2011-07-21 01:34:09
【问题描述】:

我希望用户能够从我的网站在他们的墙上发帖。当我点击提交到 FB 链接时,Facebook 弹出窗口只显示“发生错误。请稍后再试。” Firebug 只是说错误是“图像损坏或截断:”。如果尝试任何 FB 方法,例如 FB.login 或 FB.getLoginStatus,我会收到相同的消息。我知道这没什么好做的,但是有人知道出了什么问题,或者有更好的调试方法吗?

function load_FB(){
  FB.init({
    appId  : xxxxxxxxxxxxxxxx,
    status : true,
    cookie : true, 
    xfbml  : true  
  });
}

var publish = {method: 'feed', message: 'my message'};
function publish_wall_post()
{
  FB.ui(publish);
}

【问题讨论】:

    标签: facebook facebook-graph-api


    【解决方案1】:

    查看https://developers.facebook.com/docs/reference/javascript/FB.ui/ 的 FB.ui 文档

     FB.ui(
       {
         method: 'feed',
         name: 'Facebook Dialogs',
         link: 'https://developers.facebook.com/docs/reference/dialogs/',
         picture: 'http://fbrell.com/f8.jpg',
         caption: 'Reference Documentation',
         description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
         message: 'Facebook Dialogs are easy!'
       },
       function(response) {
         if (response && response.post_id) {
           alert('Post was published.');
         } else {
           alert('Post was not published.');
         }
       }
     );
    

    【讨论】:

      【解决方案2】:

      thinkdiff 有一个关于如何在墙上发布的很好的工作示例。 http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-21
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多