gpt4 book ai didi

android - ionic 应用程序-应用程序配置不允许给定 URL

转载 作者:行者123 更新时间:2023-11-29 20:46:44 24 4
gpt4 key购买 nike

我正在使用 ionic 和 FB 图形 API 开发应用。

在我的浏览器上调试和运行时,一切似乎都很好,但在我的 Android 设备上却不是:函数“FB.getLoginStatus(....”不会返回,并且在使用 adb 进行调试时,我收到以下错误消息:

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

如果这是来自 Facebook 开发人员控制台的配置问题,如果您能具体说明应该填写的字段,我将不胜感激)

我的部分代码:(app.js)

window.fbAsyncInit = function() {
FB.init({
appId : '1443507049279750',
xfbml : true,
status : true,
cookie : true,
version : 'v2.3'
});
console.log("ghghghg");
isInit = true;
};


(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 = "http//connect.facebook.net/en_US/sdk/debug.js";
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

在其中一个 Controller 内:

$scope.fbLogin = function() {
FB.getLoginStatus(function(response) {
console.log(response.status);

if (response.status === 'connected') {

$User.initUser();

$state.go('tab.dash');

}
else{

FB.login(function (response){
console.log("hg");
console.log(response);
}, {scope: 'email,public_profile,user_friends'});
}

});
}

非常感谢!

最佳答案

您需要更改平台目录(ios/facebook_login/*info.plist)中的*info.plist文件你需要有:

<key>FacebookAppID</key>
<string>your_appid</string>
<key>FacebookDisplayName</key>
<string>your_displayname</string>
<key>URL types</key>
<array>
<dict>
<key>URL Schemes</key>
<array>
<string>fb597296183741619</string>
</array>
</dict>
</array>

关于android - ionic 应用程序-应用程序配置不允许给定 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30171825/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com