facebook用户界面中共享对话框的API错误代码:191

API Error Code: 191 for Share Dialog in facebook UI

本文关键字:API 错误代码 对话框 用户界面 共享 facebook      更新时间:2023-09-26

facebook UI共享对话框API错误码: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基本信息

我没看到任何问题,一切看起来都很好:

App ID: 471513259597047
Display Name: Calculator
Site URL: http://www.calculator.com

我填写了所需的一切,但我仍然得到191错误。顺便说一下,我正在本地主机上测试这个。

    <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>

我认为,在developers.facebook.com上创建facebook应用程序时指定的URL与代码中指定的URL之间存在一些不匹配,交叉检查。