duansha8115 2012-02-20 17:38
浏览 21
已采纳

将故事/消息发布到多个朋友的Feed / Wall

I have the following JavaScript code to publish/post a message to friend's Wall, as this code publishes to only one friend's Wall. What I am trying to do is, to publish/post one message to multiple friends' Wall. Any help please...!

  function postToFeed() {

    // calling the API ...
    var obj = {
      method: 'feed',
      link: 'https://developers.facebook.com/docs/reference/dialogs/',
      picture: 'http://fbrell.com/f8.jpg',
      name: 'Facebook Dialogs',
      caption: 'Reference Documentation',
      description: 'Using Dialogs to interact with users.',
      to: 'FRIND_ID'
    };

    function callback(response) {
      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
    }

    FB.ui(obj, callback);
  }
  • 写回答

2条回答 默认 最新

  • donglian8407 2012-02-20 18:51
    关注

    As far as I'm aware that's not possible with the js sdk, unless of course you want to open a dialog per post...

    You can however ask for the *publish_stream* and then make the posts on the server side, there you can issue as many posts as you want. Here too you'll be able to send one post at a time, but you can do it more than once without bothering the user with a dialog for every post.

    EDIT

    The documentation for permissions: http://developers.facebook.com/docs/reference/api/permissions/ states:

    publish_stream

    Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. With this permission, you can publish content to a user's feed at any time, without requiring offline_access. However, please note that Facebook recommends a user-initiated sharing model.

    As for how to do it actually, you tagged this question as "php", and so you should use the facebook php sdk, with that it's pretty simple and straight forward how to do it, and you have the official tutorial: http://developers.facebook.com/docs/reference/php/facebook-api/ (go to the Post a link to a User's wall using the Graph API)

    Hope this is clear enough.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100