工作灯Facebook应用程序错误:“给定的URL是不允许的应用程序配置”
Worklight Facebook app error: "Given URL is not allowed by the Application configuration"
我遵循了这个教程:https://developers.facebook.com/docs/reference/javascript/#loading,这是我的IBM Worklight应用程序中的common/myapp.html中的代码:
<!DOCTYPE HTML>
<html xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta charset="UTF-8">
<title>Buy3</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="stylesheet" href="css/Buy3.css">
<script>window.$ = window.jQuery = WLJQ;</script>
</head>
<body id="content" style="display: none;">
<!--application UI goes here-->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxx', // App ID
channelUrl : 'http://stormy-sands-2143.herokuapp.com/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
oauth: true
});
};
// Load the SDK asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "http://connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
// Here we run a very simple test of the Graph API after login is successful.
// This testAPI() function is only called in those cases.
function testAPI() {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
//Log.i(TAG, "Logged in...");
});
}
</script>
<!--Below we include the Login Button social plugin. This button uses the JavaScript SDK to-->
<!--present a graphical Login button that triggers the FB.login() function when clicked.-->
<div id="user-info"></div>
<button id="fb-auth" onclick="FB.login();" >Login</button>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script src="js/initOptions.js"></script>
<script src="js/Buy3.js"></script>
<script src="js/messages.js"></script>
</body>
</html>
以下是我的Facebook应用程序配置中的一些值:
App ID: "XXX"
Display Name: "[blah blah blah]"
Namespace: jfgjfgjhfgjh
App domains:stormy-sands-2143.herokuapp.com
HostingURL: https://stormy-sands-2143.herokuapp.com
Sandbox Mode: "Disable"
Site Url: http://stormy-sands-2143.herokuapp.com/
Canvas Page: http://apps.facebook.com/jfgjfgjhfgjh
Canvas URL: http://stormy-sands-2143.herokuapp.com/
Secure Canvas URL: https://stormy-sands-2143.herokuapp.com/
Page Tab URL: http://stormy-sands-2143.herokuapp.com/
Secure Page Tab URL: https://stormy-sands-2143.herokuapp.com/
注意,我必须改变js。SRC参数靠近教程中给出的示例代码的底部,与我的通道文件中的参数相同。
然后当我点击登录按钮,我看到facebook登录对话框,我已经把电子邮件和密码,然后点击确定,我有错误:
给定的URL不被应用程序配置允许。:一个或应用程序的设置不允许更多的给定url。它必须匹配网站URL或画布URL,或者域名必须是子域名
我在stackoverflow和google上搜索了所有内容,但无法解决此错误。谢谢你的帮助!
好了,只需删除关于heroku的所有内容,然后像这样配置app
App domains:localhost
HostingURL:
Sandbox Mode: "Disable"
Site Url: http://localhost/
Canvas Page: http://apps.facebook.com/jfgjfgjhfgjh
Canvas URL: http://localhost/
Secure Canvas URL: https://localhost/
Page Tab URL: http://localhost/
Secure Page Tab URL: https://localhost/
然后在HTML
//channelUrl : 'http://stormy-sands-2143.herokuapp.com/channel.html'
。如果有人需要的话
相关文章:
- 使用应用程序状态js和视图在angular js url上传递两个参数
- 从使用react路由器的网络应用程序解析物理URL
- 将 MVC 3 应用程序部署到 URL 文件夹已损坏 JavaScript 和内容路径
- 读取Angular应用程序中请求的url
- Facebook JavaScript SDK:读取应用程序URL
- 无法'共享'Firefox操作系统上Facebook和Twitter本地应用程序上的URL
- 在express应用程序中,请求参数两次附加到URL
- Facebook选项卡应用程序动态URL
- 获取包含我的谷歌应用程序脚本的页面的url
- 为什么使用MEAN.js应用程序'URL以#开头
- 如何从struts2应用程序中的AJAX调用url调用servlet
- 是否可以提供一个特定的URL,供任何在网络应用程序中为页面添加书签的人使用
- 有没有任何方法可以在单页应用程序中记录url和哈希片段
- 如何使用chrome文件系统api从chrome应用程序中的url下载图像
- 如何检查“http://”是否包含在 Angular .js 应用程序的 url 输入中
- 如何从MyApp Android打开Web浏览器应用程序的URL
- Facebook登录后无法重定向到应用程序URL
- RCTLinkingManager :在 iOS 中侦听应用程序 URL
- 有MS Word的应用程序URL协议吗
- 如何在每次用户在新浏览器窗口中访问应用程序 URL 时以编程方式在 IE 中创建新的浏览器会话