您确实需要stream.publish权限才能使用stream.publish方法或等效的图形API调用。
您可以检查用户已经授予该权限,像这样的东西:你可以响应
FB.login(function(response) { /* check perms */ }, {scope: 'publish_stream'})
然后:
FB.getLoginStatus(function(response) { if (response.perms) { /* check perms */ } })
你可以用一些请求允许这样的检查它是否真的被授予,那么你应该可以做流发布调用。
但是,我不认识你的电话“Facebook.streamPublish”的格式。我认为,新的API需要你做一个呼叫更像
FB.api({method: 'stream.publish', message: 'hello'}, function(response) {})
或者这一切,你可以使用对话框API来创建一个帖子,并将其展示给用户,并让他们批准,或不批准。这不需要stream.publish权限。像这样的东西(在FB.ui API文档中给出的示例):
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: 'http://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
message: 'Facebook Dialogs are easy!'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
在Facebook的速度变化,我希望一些这方面的信息仍然是时间精确你读它(甚至精确到开始用)。
Facebook.streamPublish在一年前不赞成使用 – 2011-05-02 13:10:00