cordova facebook connect plugin - 应用程序配置不允许给定URL

时间:2014-04-19 08:47:05

标签: javascript android facebook facebook-graph-api cordova

我在我的应用中使用了以下代码

用于浏览器

// Load the SDK's source Asynchronously
// Note that the debug version is being actively developed and might 
// contain some type checks that are overly strict. 
// Please report such bugs using the bugs tool.
(function(d, debug){
     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" + (debug ? "/debug" : "") + ".js";
     ref.parentNode.insertBefore(js, ref);
}(document, /*debug*/ false));

FB.init(
                    {
                        appId: fbid,
    //                  nativeInterface: CDV.FB,
                        cookie:true,
                        status:true,
                        xfbml:true
                    });

它在浏览器中完美运行。

然后在我的phonegap应用程序之后,我已经提交了https://github.com/phonegap/phonegap-facebook-plugin登录facebook功能。我在index.html中添加了“cdv-plugin-fb-connect.js”和“facebook-js-sdk.js”文件

我在上面评论了动态javascript SDK代码。登录时我使用了

FB.init(
                {
                    appId: fbid,
//                  nativeInterface: CDV.FB,
                    cookie:true,
                    status:true,
                    xfbml:true
                });

但是在模拟器中我收到错误Given URL is not permitted 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.所以,请您建议解决此问题。

0 个答案:

没有答案