我正在使用 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;
它工作正常,但我想知道是否有办法可以发布到多个朋友的墙上?我注意到弹出窗口在列表中显示了一位目标朋友,因此似乎可以将帖子发布给多个用户。我在文档中找不到任何内容,任何帮助将不胜感激。
不可以,您无法在一次通话中向多个好友直播发布内容。
最好的方法可能是在服务器端,这样用户就不会收到多个提示。请注意,这通常是不鼓励的,因为它可能被视为垃圾邮件。
使用您的代码,您可以仅循环发送事件部分:
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;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)