Facebook 'send' dialog to multiple friends

徘徊边缘 提交于 2019-12-12 11:44:45

问题


The idea is that the user can request feedback on what they have made from a couple of friends.

I have a friend selector which is working great.

From here I get the user id's. I then call the send dialog and instead there being multiple recipients there is only one. Does anyone know why?

FB.ui({
    method: 'send',
    name: 'Test',
    to: formattedContacts,
    link: 'http://google.com'
});

If I log the formattedContacts I get the following. (id's removed)

["11111", "222222"]

The send dialog appears fine but only the first users appears as a recipent.

Does anyone know how to open the dialog with multiple recipients?


回答1:


Send dialog only provides way to chose one user automatically. User who see dialog may add other users as well, but application currently cannot do this.

From Send Dialog documentation:

to - A user ID or username to which to send the message. Once the dialog comes up, the user can specify additional users, Facebook groups, and email addresses to which to send the message. Sending content to a Facebook group will post it to the group's wall.




回答2:


If you are using the FB js-sdk you can specify multiple recipients like so:

FB.ui({
      method : 'send',
      to : [12345, 99999, 54321],
      link : "http://google.com/"
    }, function(param) {
      console.log(param);
});

But yes, popping the Send Dialog using a url (instead of using FB.ui()) will accept one UID only.



来源:https://stackoverflow.com/questions/9837270/facebook-send-dialog-to-multiple-friends

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!