非常奇怪的是,messenger复选框插件充当了魅力,然后停止显示。
我正在获得"呈现"事件被触发但是复选框的iFrame的高度和宽度等于0.
如果我手动更改,插件将变为可见。
我们也没有收到webhook的回复。
任何人都知道从哪里开始?
以下是相关代码: 复选框元素:
<div class="fb-messenger-checkbox"
origin="domain"
page_id="Our page id"
messenger_app_id="our app id"
user_ref="UniqueId"
allow_login="true"
size="small"
>
</div>
活动:
window.fbAsyncInit = function() {
FB.init({
appId : 'our app id',
xfbml : true,
version : 'v2.6'//our webhooks version
});
FB.Event.subscribe('messenger_checkbox', function(e) {
if (e.event == 'rendered') {
console.log("Plugin was rendered");//FIRED EACH TIME!
} else if (e.event == 'checkbox') {
if(e.state === "checked") {
chkbxplgnSelected = true;
}
else
chkbxplgnSelected = false;
console.log("Checkbox state: " + e.state);
} else if (e.event == 'not_you') {
console.log("User clicked 'not you'");
} else if (e.event == 'hidden') {
console.log("Plugin was hidden");
}
});
};
注意事项:
在设置为移动设备的开发者模式下加载页面时,控制台中会显示以下错误:
(Only on mobile inspection)
无效的X-Frame-Options&#39;加载&#39; https://www.facebook.com/v2.6/plugins/messenger_checkbox.php?allow_login=true&app_id=446487378882911&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FFdM1l_dpErI.js%3Fversion%3D42%23cb%3Df2172ca0fd08e74%26domain%3Dcdn.tictuk.com%26origin%3Dhttps%253A%252F%252Fcdn.tictuk.com%252Ffea4c513e273dc%26relation%3Dparent.parent&container_width=0&locale=en_US&messenger_app_id=446487378882911&origin=https%3A%2F%2Fcdn.tictuk.com&sdk=joey&size=small&#39;:&#39;允许来自https://www.facebook.com&#39;不是公认的指令。标题将被忽略。