Facebook客户聊天插件不起作用

时间:2019-01-22 14:26:47

标签: facebook sdk facebook-chat

聊天插件无法正常工作,在网站上正确安装了所有内容,但是聊天未出现在网站上。我检查了控制台-与SDK的连接正常,可能是什么问题?

<div id="fb-root"></div>
<script>(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 = 'https://connect.facebook.net/ru_RU/sdk/xfbml.customerchat.js';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-customerchat"
  page_id="184854859536XXXX">
</div>

1 个答案:

答案 0 :(得分:0)

<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId            : 'facebook-developer-app-id',
      autoLogAppEvents : true,
      xfbml            : true,
      version          : 'v3.2'
    });
  };
(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 = "https://connect.facebook.net/ru_RU/sdk/xfbml.customerchat.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

<!-- Your customer chat code -->
<div class="fb-customerchat"
  attribution=setup_tool
  page_id="YOUR ID"
  logged_in_greeting="Hello. How we can help you?"
  logged_out_greeting="Hello. How we can help you?">
</div>