質問

I am having trouble getting code correct to have user (of my app) post to friend's wall. I want user to be able to pick single friend and post to thier stream. What am I missing to have the user select 1 friend from list, or type friends name? This is my "post" function that I can't get to work. It works when the method is 'feed' to post to the user's wall. But method as 'stream.publish' it still functions like 'feed' and posts to user's wall.

     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();});
  }
役に立ちましたか?

解決

It looks like you're looking for the 'send' User Interface.

There are docs on this here: https://developers.facebook.com/docs/reference/dialogs/send/

It's practically the same code as your feed dialog, except the user can specify which friends they want to communicate it to.

Assuming your code is correct this would work:

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();});
  }

You just choose method: 'send' and then use the properties shown on the 'feed' documentation, here: http://developers.facebook.com/docs/reference/dialogs/feed/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top