繁体   English   中英

Facebook Canvas:redirect_uri不属于该应用程序

[英]Facebook Canvas: redirect_uri is not owned by the application

我试图将Facebook canvas集成到当前运行在localhost:8080 Web应用程序上的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.

这是我的应用设置。

在此处输入图片说明

我只是在遵循文档,并且出现了此错误,

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'));

您需要在“画布url”中放置的URL可能是localhost:8080(应用程序url由“名称空间”确定,并且始终为http://apps.facebook.com/namespace (对于您的应用。)

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM