我在我的html页面中使用了这个......
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'xxxxxxxxxxxxxx', // App ID from the App Dashboard
status : true, // check the login status upon init?
cookie : true, // set sessions cookies to allow your server to access the session?
xfbml : true // parse XFBML tags on this page?
});
// Additional initialization code such as adding Event Listeners goes here
};
// 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));
function shareOnFb(action, msg){
FB.ui({
method: action,
message: msg
});
}
</script>
当我每次尝试调用任何 FB 方法时,它都会在我的控制台中显示
应用程序配置不允许给定 URL。:应用程序的设置不允许一个或多个给定 URL。它必须与网站 URL 或画布 URL 匹配,或者域必须是应用程序域之一的子域。
这是我的 fb 应用程序设置.. 我需要在这里更改一些东西吗,我暂时在本地运行我的网站,所以我尝试添加
localhost/OfferDrive/ 到此页面上的应用程序域,但它说错误,它不是一个有效的域