问题
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
- Auser ID
orusername
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