我正在使用下面的代码在我的 friend 墙上发帖。
此代码的问题是,它正在提示,当我单击“仅共享”时它会发布,但我希望它在用户墙上发布,他已经授予了权限。
function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: name,
caption: '',
description: (description),
href: hrefLink
},
action_links: [
{ text: hrefTitle, href: hrefLink }
],
user_prompt_message: userPrompt
},
function(response) {
});
}
streamPublish();
我尝试删除该 user_prompt_message 但它仍然提示。
提前致谢。
最佳答案
您正在那里使用提要对话框;这会打开一个 Facebook 提供的对话框,供用户在内容发布到他们的提要之前预览和确认内容。
如果您想使用 publish_stream
扩展权限直接发布到用户供稿,您需要直接对 /{USER ID}/feed
进行 API 调用 - 请参阅https://developers.facebook.com/docs/reference/api/user/#feed获取更多信息。
请记住,用户仍然需要同意以他们的名义发布的每个帖子,只是不需要您使用 Facebook 的提要对话框来这样做
关于javascript - 经许可在用户墙上发帖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8267751/