1
我嵌入了Facebook发送按钮。它有效,所以我可以通过它发送消息和链接。Facebook发送按钮有效,但不会触发'message.send'事件
但是,message.send事件不会触发。
我再次尝试,但现在有一个新的页面,除了代码我从here和here和FB.Event.subscribe文档复制粘贴的代码除外。
我在控制台中没有得到任何错误。
任何帮助将不胜感激。
我的代码:
<!doctype html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'XXXXXXXXXXXXXXXXXXXXX', // App ID from the app dashboard
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel file for x-domain comms
cookie : true, // enable cookies to allow the server to access the session
status : true, // Check Facebook Login status
xfbml : true, // Look for social plugins on the page
oauth : true
});
FB.Event.subscribe('message.send',
function(response) {
alert('You sent the URL: ' + response);
}
);
};
(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 = "//connect.facebook.net/en_US/all/debug.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:send href="http://www.google.com"></fb:send>
Test test
</body>
</html>
我也有这个问题。我没有订阅其他事件的问题(例如喜欢,评论),但从来没有从这个“message.send”事件得到回调...... – logidelic