使用fb.ui(方法:“stream.publish”…)
它无法接受我的附件媒体抱怨它应该是一个数组(虽然它是)。
旧的API(fb.connect.streampublish)接受了这种格式,而且所有其他选项似乎都有效。
我发现facebook文档一团糟,有人用新版本处理了这个?
整个帖子创建如下:
var attachment = {media: new Array({type:'image',
src:'http://xxxxxxx' + baseurl + 'img/facebook-share_big.png',
href:'http://xxxxxxx' + baseurl}),
name: 'xxxxxxx',
description: message,
href: 'http://xxxxxxx' + baseurl};
var action = [{text: 'xxxxxxx', href: 'http://xxxxxxx' + baseurl}];
FB.ui({
method: 'stream.publish',
message: 'xxxxxxx',
attachment: attachment,
action_links: action,
user_message_prompt: 'xxxxxxx'
});