我正在使用Javascript SDK将内容发布到用户朋友的墙上:
var publish =
{
method: 'stream.publish',
message: 'Some kind of test',
uid: uid,
target_id: friendID,
attachment: {
name: 'Test',
caption: 'Facebook API Test',
description: ('Sure hope it worked!'),
href: 'http://www.test.com/',
media: [
{
type: 'image',
href: 'http://test.com/',
src: 'http://test.com/image.jpg'
}
]
},
action_links: [
{ text: 'Enigma Marketing', href: 'http://www.test.com/' }
],
user_prompt_message: 'Share your thoughts about test'
};
FB.ui(publish);
return false;
工作正常,但我想知道是否有办法可以发布到MULTIPLE朋友的墙上?我注意到pop在列表中显示的目标朋友很少,所以似乎可以将帖子发布给多个用户。我在文档中找不到任何内容,非常感谢任何帮助。
答案 0 :(得分:5)
不,你不能在一次通话中发布给多个朋友流。
执行此操作的最佳方法可能是服务器端,以便用户不会收到多个提示。请注意,这通常是不鼓励的,因为它可以被视为垃圾邮件。
使用您的代码,您可以只循环发送事件部分:
var publish =
{
method: 'stream.publish',
message: 'Some kind of test',
uid: uid,
attachment: {
name: 'Test',
caption: 'Facebook API Test',
description: ('Sure hope it worked!'),
href: 'http://www.test.com/',
media: [
{
type: 'image',
href: 'http://test.com/',
src: 'http://test.com/image.jpg'
}
]
},
action_links: [
{ text: 'Enigma Marketing', href: 'http://www.test.com/' }
],
user_prompt_message: 'Share your thoughts about test'
};
publish.target_id = friendID;
FB.ui(publish);
publish.target_id = friendID;
FB.ui(publish);
return false;