Facebook - 发贴到多个朋友的墙壁 [英] Facebook - Post to multiple friends walls

查看:80
本文介绍了Facebook - 发贴到多个朋友的墙壁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using the Javascript SDK to post something onto a users friends wall:

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;

它工作正常,但我想知道是否有一种方式可以发布到MULTIPLE朋友的墙壁?我注意到流行音乐在列表中显示一个目标朋友很少,所以似乎可能将该帖子发布到多个用户。我在文档中找不到任何内容,任何帮助都将不胜感激。

It is working ok, but I was wondering if there was a way I could post to MULTIPLE friends walls? I noticed that the pop shows a target friend in a list few, so it seems it may be possible to publish the post to more than one user. I can't find anything in the documentation, any help would be greatly appreciated.

推荐答案

不,您不能发布到多个朋友流入一个通话。

No, you cannot post to multiple friends stream in one call.

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

The best way to do it is probably server side so that the user does not get multiple prompts. Notice this is usually discouraged though since it can be perceived as spam.

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

With your code, you can loop on just the send event part:

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;

这篇关于Facebook - 发贴到多个朋友的墙壁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆