API 错误代码:Facebook UI 中共享对话框的 191
我一直在努力让 FB.ui 工作。不幸的是,我不断收到错误消息:
An error occurred. Please try again later.
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.
如果我在https://developers.facebook.com/中访问我的应用程序基本信息
我没有看到任何问题,一切看起来都很好:
App ID: 471513259597047
Display Name: Calculator
Site URL: http://www.calculator.com
我填写了所需的所有内容,但仍然收到 191 错误。顺便说一下,我正在 localhost 中测试这个。
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>My Feed Dialog Page</title>
</head>
<body>
<div id='fb-root'></div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p><a onclick='postToFeed(); return false;'>Post to Feed</a></p>
<p id='msg'></p>
<script>
FB.init({appId: "471513259597047", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
redirect_uri: 'http://www.calculator.com',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with people.'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>
</body>
</html>