私は自分の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 の 1 つ以上がアプリの設定によって許可されていません。ウェブサイトの URL またはキャンバスの URL と一致するか、ドメインがいずれかのアプリ ドメインのサブドメインである必要があります。
これは私のfbアプリの設定です..ここで何かを変更する必要がありますか.当面はローカルでウェブサイトを実行しているので、追加してみました
このページで localhost/OfferDrive/ をアプリ ドメインに追加しましたが、有効なドメインではないというエラーが表示されます