我正试图在Facebook墙上发布消息...... 登录弹出窗口,但登录按钮按下它显示错误'应用程序配置不允许给定URL:应用程序的设置不允许一个或多个给定的URL。它必须与网站URL或Canvas URL匹配,或者域必须是App域之一的子域。 我无法解决这个问题,我不知道如何将消息发布到墙上并关闭弹出窗口... 任何人都可以帮助我... 这是我的帖子代码
FB.login(function()
{
FB.api('/me/feed', 'post', {message: 'Hello, world!'});
},
{
scope: 'publish_actions'
}),
function(response)
{
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
答案 0 :(得分:0)
我通过添加网站网址和应用域来解决了这个问题。
在应用程序详细信息中,在设置添加平台,然后选择网站,
提及网站网址为"http://localhost:1200/" and domain as "localhost"
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: 'Name',
//caption: 'Caption here.',
description: (
'description here'
),
href: url
}
//user_prompt_message: 'Personal message here'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);