Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-02-01 11:19:01

Gallex
Member
Registered: 2006-10-08
Posts: 1,103

Re: Facebook Customer Chat plugin

tried the second one. still the button showing up with a dialog box and console says:
Uncaught ReferenceError: FB is not defined

Offline

#12 2019-02-13 10:29:03

Gallex
Member
Registered: 2006-10-08
Posts: 1,103

Re: Facebook Customer Chat plugin

i found solution. working code below. i just needed to sign up here as a facebook developer and add into code my personal appId which i get from fb developer page. now only button showing up.

<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId            : '30...',
      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/en_GB/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="54...."
   greeting_dialog_display="hide"
  logged_in_greeting="Welcome, How we may help you?"
  logged_out_greeting="Welcome, How we may help you?">
</div>

Offline

#13 2019-02-13 16:19:38

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,253
Website

Re: Facebook Customer Chat plugin

Glad you got it working. We would have gone round in circles without you having a developer ID…


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB