From fb6f84a022ba1cc2dc1bb291db204a9e06cce793 Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Wed, 7 Feb 2024 20:03:54 +0530 Subject: [PATCH] Update intercom_flutter_web to automatically inject the Intercom script (#402) --- intercom_flutter/CHANGELOG.md | 4 ++++ intercom_flutter/README.md | 6 +++--- intercom_flutter/example/web/index.html | 3 --- intercom_flutter/pubspec.yaml | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/intercom_flutter/CHANGELOG.md b/intercom_flutter/CHANGELOG.md index 23d59d58..f30a4532 100755 --- a/intercom_flutter/CHANGELOG.md +++ b/intercom_flutter/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 8.0.11 + +* Automatically Injected Intercom Script, if it is not added. + ## 8.0.10 * Bump Intercom iOS SDK version to 16.5.5 diff --git a/intercom_flutter/README.md b/intercom_flutter/README.md index e84e2858..0105f5b0 100755 --- a/intercom_flutter/README.md +++ b/intercom_flutter/README.md @@ -130,13 +130,13 @@ Intercom.instance.sendTokenToIntercom(intercomToken); Now, if either Firebase direct (e.g. by your own backend server) or Intercom sends you a message, it will be delivered to your app. ### Web -Add the below script inside body tag in the index.html file located under web folder +You don't need to do any extra steps for the web. Intercom script will be automatically injected. +But you can pre-define some Intercom settings, if you want (optional). ```html ``` #### Following functions are not yet supported on Web: diff --git a/intercom_flutter/example/web/index.html b/intercom_flutter/example/web/index.html index 61b23264..39739d35 100644 --- a/intercom_flutter/example/web/index.html +++ b/intercom_flutter/example/web/index.html @@ -32,9 +32,6 @@ window.intercomSettings = { hide_default_launcher: true, // set this to false, if you want to show the default launcher }; - - (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); -