Reputation: 77
So basically, I'm using tawk.to as the free chat service for my client's application built on AngularJS The issue is that whenever I open the chat widget on mobile device and reopen it after closing it once, it closes automatically, thereby making it impossible for users to chat.
As per the official site's instruction, all we had to do was paste a script at the bottom, like so:
var $_Tawk_API={},$_Tawk_LoadStart=new Date(); (function(){ var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; s1.async=true; s1.src='https://embed.tawk.to/57e650264a427d157423018b/default'; s1.charset='UTF-8'; s1.setAttribute('crossorigin','*'); s0.parentNode.insertBefore(s1,s0); })();
Upon further digging, I found that the issue was due to the hash prefixing which adds a # on the address bar, and whenever we click on the "Start Chat" button, it adds another # to the address, so in order to escape that it converts it into %23 and therefore the chat widget closes.
I've tried looking for the solution everywhere to no avail.
Can anyone help me out with this bugger ?
Upvotes: 0
Views: 1397
Reputation: 16
Place this after the widget loads :
Tawk_API = Tawk_API || {}; Tawk_API.disableMobileBackHistory = true;
Here is a working example :
http://rd.tawk.to/mobile-maximize/
Cheers,
Robert
Upvotes: 0