Facebookページがあります。人が「いいね」ボタンをクリックしたかどうかを知り、subscribe.event 'create-edge'
コールバックで何かをしたい。人がすでにFacebookにログインしている場合、これは正常に機能します。'create-edge'
イベントは解雇されています。ただし、人がログインしていない場合、このイベントは発生しません。
持っていないappId
ので何も送っていません。
参考のためのコード:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" >
<head>
<meta charset="utf-8">
<title>Facebook Like Button</title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '', // App ID
channelURL : '', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : false, // enable OAuth 2.0
xfbml : true // parse XFBML
});
FB.Event.subscribe('edge.create', function(response) {
alert("say something");
//my code
});
FB.Event.subscribe('auth.login', function(response) {
alert('The status of the session is: ' + response.status);
});
};
// 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 = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
<fb:like href="http://www.facebook.com/My_Page" send="false" layout="button_count" width="450" show_faces="false"></fb:like>
</body>
</html>
また、このエラーが発生しています:
FB.init()を呼び出す前にFB.getLoginStatus()が呼び出されました。
appId
送信するものがないため、取得しているようですFB.init
。これの原因は何ですか?