我正在使用FB.ui将文章发布到Facebook用户墙上。但是,我不确定要使用哪些参数来发布到页面或应用程序墙。有联系吗?
我试图张贴到网页墙作为该网页,而不是作为用户的帐户。
发送到用户帐户的代码:
FB.ui(
{
method: 'feed',
name: name,
link: link,
picture: picture,
caption: caption,
description: redemption,
message: message
},
function (response) {
if (response && response.post_id) {
alert(response.post_id);
} else {
}
}
);发布于 2011-01-11 00:51:44
明白了:
您必须设置to和from值:
FB.ui( {
method: 'feed',
name: name,
link: link,
picture: picture,
caption: caption,
description: redemption,
message: message,
to: page_id,
from: page_id
},
function (response) {
if (response && response.post_id) {
alert(response.post_id);
} else {
}
}
);发布于 2011-01-10 11:57:17
我使用JavaScript SDK在用户的墙上发布:
function graphStreamPublish(){
var body = document.getElementById("txtTextToPublish").value;
FB.api('/me/feed', 'post', { message: body }, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Post ID: ' + response.id);
}
});
}当我浏览图API页时,我认为如果您将'/me/feed/'更改为'pageId/feed',那么它可能会在该页面中发布消息。我不确定。-只是个建议
发布于 2012-02-21 20:06:00
在朋友的墙上分享,截至2012年2月:
FB.ui({
method: 'stream.publish',
app_id: appId,
display: 'iframe',
name: name,
link: link,
picture: picture,
caption: caption,
description: description,
target_id: friendIds
});https://stackoverflow.com/questions/4636899
复制相似问题