开发者

Facebook send dialog to multiple friends using a recipients arrays

The Facebook new Send Dialog lets people to send content to specific friends. But the API @ https://developers.facebook.com/docs/reference/dialogs/send/ said the parameter 'TO' means "A user ID or username".

I wonder is there a method to send message to multiple friends at one time. I tried to set the 'to' as a javasc开发者_JAVA技巧ript arrays, but that does not work.


It seems that currently the sdk only takes the first element from the array that is passed to "To" parameter. This is really annoying and no formal explanation is given to this design decision. I'd wish it can take more than one uids or emails, group names etc.


I'm not sure how you're doing it or what you define as "works", but the below kind of works:

Go to the javascript test console here: https://developers.facebook.com/tools/console/ And type in the following, and hit run, it will bring up a send dialog with two names prepopulated. Unfortunately, when you hit send, it goes to an error page (still trying to figure that one out). But still, it does populate the dialog with two names :P

<script>
    FB.ui(
     { 
      method: 'send', 
      to: [5,6],
      link: "https://developers.facebook.com",
      picture: "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/174597_20531316728_2866555_q.jpg"
     }, 
     function(param){
            // If they cancel params will show: 
            //    {action:false, ...}
            // and if they send the friend request it'll have:
            //    {action:true, ...}
            // and if they closed the pop-up window then:
            //    param is undefined
     }
    );
</script>


Seems both ways, direct URL and Javascript don't allow to use a list of ID's , just checked and verified it today


I tried with a comma separated list of IDs, in the 'TO' field, and it worked ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜