Facebook FBui'stream.publish'给单身朋友(需要帮助)

时间:2011-10-11 20:46:59

标签: facebook post facebook-graph-api stream facebook-java-api

我无法让代码更正,让用户(我的应用)发布到朋友的墙上。我希望用户能够选择单个朋友并发布到他们的流。如果用户从列表中选择1位朋友,或者输入朋友姓名,我错过了什么?这是我的“帖子”功能,我无法工作。当方法是'feed'发布到用户的墙上时,它可以工作。但是作为'stream.publish'的方法它仍然像'feed'一样起作用并发布到用户的墙上。

     function pubStream(obj,gift_id,item_name)
     {
     FB.ui({
            method: 'stream.publish',
            display: 'popup',     //have tried display:iframe does same             
            name: "Special Delivery!",
            link: "<?php echo $app_info['transfer_protocol']; ?>apps.facebook.com/<?php echo $app_info['canvas']; ?>/?friendID="+facebook_id+"&giftID="+gift_id,
            picture: "<?php echo $app_info['upload_url']; ?>"+obj,
            caption: "//not used at this time ",
            description: "my item escription",
            message: "user's message ",
            actions: {"name":"my items name","link":"<?php echo $app_info['transfer_protocol']; ?>apps.facebook.com/<?php echo $app_info['canvas']; ?>/?friendID="+facebook_id+"&giftID="+gift_id}
    },function(response){hideLightbox();});
  }

1 个答案:

答案 0 :(得分:2)

看起来你正在寻找'发送'用户界面。

这里有文档: https://developers.facebook.com/docs/reference/dialogs/send/

它与您的Feed对话框实际上是相同的代码,但用户可以指定他们想要与之通信的朋友。

假设您的代码是正确的,这将起作用:

function pubStream(obj,gift_id,item_name)
     {
     FB.ui({
            method: 'send',
            display: 'popup',     //have tried display:iframe does same             
            name: "Special Delivery!",
            link: "<?php echo $app_info['transfer_protocol']; ?>apps.facebook.com/<?php echo $app_info['canvas']; ?>/?friendID="+facebook_id+"&giftID="+gift_id,
            picture: "<?php echo $app_info['upload_url']; ?>"+obj,
            caption: "//not used at this time ",
            description: "my item escription",
            message: "user's message ",
            actions: {"name":"my items name","link":"<?php echo $app_info['transfer_protocol']; ?>apps.facebook.com/<?php echo $app_info['canvas']; ?>/?friendID="+facebook_id+"&giftID="+gift_id}
    },function(response){hideLightbox();});
  }

您只需选择method: 'send',然后使用'Feed'文档中显示的属性,此处为:http://developers.facebook.com/docs/reference/dialogs/feed/