【问题标题】:facebook api with private message multiple to (friends)facebook api,带有多个给(朋友)的私人消息
【发布时间】:2012-06-03 09:27:03
【问题描述】:

我使用 facebook api 开发 facebook 私人消息以进行邀请。

<script>
    FB.init({ appId: 'xxxxxxxxxx', xfbml: true, cookie: true });
    FB.ui({
        method: 'send',
        to: ['1736383768','590528674'],

        // picture: 'http://thinkdiff.net/iphone/lucky7_ios.jpg',
        //Can be page, popup, iframe, or touch. 
        display: 'popup',
        name: 'yyyyyy',
        link: '<%=Request.QueryString["link"]%>'
    });

 </script>

但只添加大副。

如何给多个好友发私信?

【问题讨论】:

标签: facebook facebook-graph-api facebook-c#-sdk


【解决方案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: 'Your text', 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;

【讨论】:

    【解决方案2】:

    您不应该使用 stream.publish。 正如 facebook 所说:“我们正在弃用 REST API,所以如果你正在构建一个新应用程序,你不应该使用这个函数。而是使用 Graph API 并将 Post 对象发布到 feed 连接用户对象”

    所以,现在您剩下了 send 和 feed 方法。

    您不能用多个用户 ID 填写发送方法(只有当您被 facebook 列入白名单时才可以,但我不太清楚如何执行此操作,我也不会指望它)。

    您可以使用 feed 方法在许多用户的朋友墙上发布类似这样的内容

    FB.api('/USERID/feed', 'post', {
      name:postName,
      link:postLink,
      picture:postPicture,
      description:postDescription,
      message:postMessage
    }, function (postResponse) { //DO SOMETHING HERE });
    

    但是这样做,如果有人将其标记为垃圾邮件,您将冒着被 Facebook 删除的风险。

    据我所知,通过应用程序向多个朋友发送消息被 facebook 视为不良/垃圾邮件,因此他们不再允许这样做。

    您仍然可以通过App request dialog(方法请求)邀请尽可能多的朋友,但我不确定这是否是您想要的。

    【讨论】:

      猜你喜欢
      • 2018-11-13
      • 1970-01-01
      • 2014-04-24
      • 1970-01-01
      • 2018-03-22
      • 1970-01-01
      • 2012-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多