gpt4 book ai didi

javascript - Facebook Canvas : redirect_uri is not owned by the application

转载 作者:行者123 更新时间:2023-11-29 17:17:36 24 4
gpt4 key购买 nike

我正在尝试将 facebook canvas 集成到我当前在 localhost:8080 上运行的 Web 应用程序中在运行该网站时,它给了我这个错误。

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.

这是我的应用设置。

enter image description here

我只是按照文档进行操作,但出现了这个错误,

window.fbAsyncInit = function() {
FB
.init({
appId : 'myappIdHere', // App ID
channelUrl : 'https://apps.facebook.com/mytestapp/', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true
// parse XFBML
});
FB.ui({
method : 'feed'
});
};
// Load the SDK Asynchronously
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

最佳答案

您需要放置在“canvas url”中的 URL 可能是 localhost:8080(应用程序 url 由“ namespace ”决定,并且始终是 http://apps.facebook.com/namespace(这对于您的应用程序来说必须是唯一的。)

您需要指定重定向 URI http://developers.facebook.com/docs/reference/dialogs/feed/

<script> 
FB.init({appId: "YOUR_APP_ID", status: true, cookie: true});

function postToFeed() {

// calling the API ...
var obj = {
method: 'feed',
redirect_uri: 'https://apps.facebook.com/mytestapp/',
link: 'https://apps.facebook.com/mytestapp/',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.'
};

function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}

FB.ui(obj, callback);
}

</script>

关于javascript - Facebook Canvas : redirect_uri is not owned by the application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15858662/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com