0

我正在使用 FB JS SDK 和 Flask 开发 FB 应用程序。我最后一次在 localhost 测试中检查我的应用程序是在 9 月底前一周,然后一切正常。

我今天回到我的应用程序,我得到了这个:

Curses! Given URL is not allowed by the Application configuration.: 
One or more of the given URLs is not allowed by the App's settings.  
It must match the Website URL or Canvas URL, or the domain must be 
a subdomain of one of the App's domains. 

两周前我的配置工作了,那么真正发生了什么变化?

代码:

function fbLogin(handle)
{
window.fbAsyncInit = function() {

if (DEBUG) console.log("start login");

FB.init({
  appId : XXXXXXXXXX,//app_id,// App ID
  //channelUrl : channel_url, // Channel File 
  channelUrl : '//127.0.0.1:5000/channel.html', // Channel File 
  status     : true, // check login status
  cookie     : true, // enable cookies to allow the server to access the session
  xfbml      : true  // parse XFBML
});

if (DEBUG) console.log("login status");

FB.getLoginStatus(function(response) 
{
    if (DEBUG) console.log("get login status"); 
    if (DEBUG) console.log(response);

    if (response.status == 'connected') {
        if (DEBUG) console.log("connecto!");
        getUser(handle);
        getFriends();
    } 
    else if (response.status === 'not_authorized') 
    {
        if (DEBUG) console.log("not auth");   
        fbLoginAPI();
    } 
    else 
    {
        if (DEBUG) console.log("not logged!");   
        fbLoginAPI();
    }
}, true);   


};

(function(d){
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    ref.parentNode.insertBefore(js, ref);
 }(document));
}

网站网址:http://127.0.0.1:5000/ 画布网址:http://127.0.0.1:5000/

我无法设置安全 url https://127.0.0.1:5000/ 因为它给了我:

Misfire
Secure Canvas URL cannot be a Facebook URL.

我尝试使用带和不带 SSL 的工头启动我的应用程序,但它仍然无法正常工作。

4

0 回答 0