我可以成功地通过
FB.ui({method: 'stream_publish',....})
.
但是,由于我的应用程序还必须能够发布到风扇页面,所以我不能使用fb.ui,而必须通过fb.api使用graph api。没什么大不了的,反正我还是要一张定做的表格。
但它似乎是通过
FB.api('/FEED_ID/feed', ...)
采用与fb.ui方法不同的参数。
文件
FB.api call
以及
Graph API
不是特别有用。图形API文档提到
source
参数,应该是Flash对象的URL。但是,当我设置
来源
要成为flash对象的url,我得到以下信息:
(100)Flash对象必须具有“swfsrc”和“imgsrc”属性。
好的,好的,但是他们去哪里?这个
attachment
对于fb.connect和fb.ui来说,这个参数工作得很好,但似乎被完全忽略了。
以下是我的代码:
body = {
name: "Name",
link: "http://mysite.com/link_to_my_content",
caption: "This is the caption",
message: "Test Message",
source: 'http://mysite.com/static/flash.swf',
image: 'http://mysite.com/static/images/facebook_thumb.png',
actions: action_links,
description: "The fascinating, compelling description"
}
FB.api('/me/feed', 'post', body, function(response){
if (!response || response.error){
console.log("FB.api error occurred");
if (response.error){
console.log("Error message: " + response.error.message);
}
}
else {
console.log("Post successful: " + response);
}
});
在发布到粉丝页面时,我还包括
access_token
参数(并且明显地更改了URL),这看起来工作正常。我只是不知道如何让Flash内容发布。在哪里
swfsrc
和
imgsrc
属性去哪?这可能看起来很明显,但我已经尽力了。谷歌没有帮助,因为大多数人似乎只是在使用
stream_publish
还有一堆旧的FB。连接东西。