【问题标题】:Facebook - Post to multiple friends wallsFacebook - 发布到多个朋友墙
【发布时间】:2010-12-03 12:22:50
【问题描述】:

我正在使用 Javascript SDK 将内容发布到用户的朋友墙上:

var publish = 

    {
              method: 'stream.publish',
              message: 'Some kind of test',
              uid: uid,
              target_id: friendID,
              attachment: {
                name: 'Test',
                caption: 'Facebook API Test',
                description: ('Sure hope it worked!'),
                href: 'http://www.test.com/',
                media: [
                  {
                    type: 'image',
                    href: 'http://test.com/',
                    src: 'http://test.com/image.jpg'
                  }
                ]
              },
              action_links: [
                { text: 'Enigma Marketing', href: 'http://www.test.com/' }
              ],
              user_prompt_message: 'Share your thoughts about test'
            };

            FB.ui(publish);
            return false;

它工作正常,但我想知道是否有一种方法可以发布到多个朋友的墙上?我注意到弹出窗口在几个列表中显示了目标朋友,因此似乎可以将帖子发布给多个用户。我在文档中找不到任何内容,我们将不胜感激。

【问题讨论】:

    标签: facebook


    【解决方案1】:

    不,您不能在一次通话中向多个朋友流发布信息。

    最好的方法可能是服务器端,这样用户就不会收到多个提示。请注意,这通常是不鼓励的,因为它可能被视为垃圾邮件。

    使用您的代码,您可以只循环发送事件部分:

    var publish = 
    
    {
              method: 'stream.publish',
              message: 'Some kind of test',
              uid: uid,
              attachment: {
                name: 'Test',
                caption: 'Facebook API Test',
                description: ('Sure hope it worked!'),
                href: 'http://www.test.com/',
                media: [
                  {
                    type: 'image',
                    href: 'http://test.com/',
                    src: 'http://test.com/image.jpg'
                  }
                ]
              },
              action_links: [
                { text: 'Enigma Marketing', href: 'http://www.test.com/' }
              ],
              user_prompt_message: 'Share your thoughts about test'
    };
    
    publish.target_id = friendID;
    FB.ui(publish);
    
    publish.target_id = friendID;
    FB.ui(publish);
    
            return false;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-20
      • 1970-01-01
      相关资源
      最近更新 更多