Need help: Integrating HTML code snippet of "2 Chat" floating button into a page in my app

Hi Guys,

I am using a chat button which is a floating button in my app. As I need to have the HTML which gives the floating button which connects to my what’s app chat,

I need help or guidance on how can I integrate this code in my app?


<script>
    window._2chatConfig = {
    phoneNumber:'+XXXXX',
    accountName: `Welcome!`,
    statusMessage: `We typically reply within 1 hour`,
    chatMessage: `Hey there! 👋
How can we help you?`,
    placeholder: 'Type your message...',
    position: 'right',
    colorScheme: 'automatic',
    showNotification: true,
  };

  (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://widgets.2chat.io/index.js';
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', '_2chat'));
</script>

Thank you for your help.

Regards,
Dilip

I tried hosting the code in Git hub and embedding it on web view.

I am able to get chat button.

Regards,
Dilip

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.