|
18 | 18 |
|
19 | 19 | <meta charset="UTF-8">
|
20 | 20 | <meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
21 |
| - <meta name="description" content="An Amplitude Flutter Web project."> |
| 21 | + <meta name="description" content="A new Flutter project."> |
22 | 22 |
|
23 |
| - <!-- iOS meta tags --> |
24 |
| - <meta name="apple-mobile-web-app-capable" content="yes"> |
| 23 | + <!-- iOS meta tags & icons --> |
| 24 | + <meta name="mobile-web-app-capable" content="yes"> |
25 | 25 | <meta name="apple-mobile-web-app-status-bar-style" content="black">
|
26 |
| - <meta name="apple-mobile-web-app-title" content="amplitude-example"> |
| 26 | + <meta name="apple-mobile-web-app-title" content="amplitude_flutter_example"> |
| 27 | + <link rel="apple-touch-icon" href="icons/Icon-192.png"> |
27 | 28 |
|
28 |
| - <title>Amplitude Example</title> |
| 29 | + <!-- Favicon --> |
| 30 | + <link rel="icon" type="image/png" href="favicon.png"/> |
| 31 | + |
| 32 | + <title>amplitude_flutter_example</title> |
29 | 33 | </head>
|
30 | 34 | <body>
|
31 |
| - |
32 |
| -<script type="text/javascript"> |
33 |
| - !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-R0H1kXlk6r2aEQMtwVcPolpk0NAuIqM/8NlxAv24Gr3/PBJPl+9elu0bc3o/FDjR",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.11.10-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var l=t.getElementsByTagName("script")[0];l.parentNode.insertBefore(c,l);for(var u=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(u,p[d]);r.Identify=u;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<v.length;y++)n(f,v[y]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}(); |
34 |
| -</script> |
35 |
| - <!-- This script installs service_worker.js to provide PWA functionality to |
36 |
| - application. For more information, see: |
37 |
| - https://developers.google.com/web/fundamentals/primers/service-workers --> |
38 |
| - <script> |
39 |
| - var serviceWorkerVersion = null; |
40 |
| - var scriptLoaded = false; |
41 |
| - function loadMainDartJs() { |
42 |
| - if (scriptLoaded) { |
43 |
| - return; |
44 |
| - } |
45 |
| - scriptLoaded = true; |
46 |
| - var scriptTag = document.createElement('script'); |
47 |
| - scriptTag.src = 'main.dart.js'; |
48 |
| - scriptTag.type = 'application/javascript'; |
49 |
| - document.body.append(scriptTag); |
50 |
| - } |
51 |
| - |
52 |
| - if ('serviceWorker' in navigator) { |
53 |
| - // Service workers are supported. Use them. |
54 |
| - window.addEventListener('load', function () { |
55 |
| - // Wait for registration to finish before dropping the <script> tag. |
56 |
| - // Otherwise, the browser will load the script multiple times, |
57 |
| - // potentially different versions. |
58 |
| - var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion; |
59 |
| - navigator.serviceWorker.register(serviceWorkerUrl) |
60 |
| - .then((reg) => { |
61 |
| - function waitForActivation(serviceWorker) { |
62 |
| - serviceWorker.addEventListener('statechange', () => { |
63 |
| - if (serviceWorker.state == 'activated') { |
64 |
| - console.log('Installed new service worker.'); |
65 |
| - loadMainDartJs(); |
66 |
| - } |
67 |
| - }); |
68 |
| - } |
69 |
| - if (!reg.active && (reg.installing || reg.waiting)) { |
70 |
| - // No active web worker and we have installed or are installing |
71 |
| - // one for the first time. Simply wait for it to activate. |
72 |
| - waitForActivation(reg.installing || reg.waiting); |
73 |
| - } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) { |
74 |
| - // When the app updates the serviceWorkerVersion changes, so we |
75 |
| - // need to ask the service worker to update. |
76 |
| - console.log('New service worker available.'); |
77 |
| - reg.update(); |
78 |
| - waitForActivation(reg.installing); |
79 |
| - } else { |
80 |
| - // Existing service worker is still good. |
81 |
| - console.log('Loading app from service worker.'); |
82 |
| - loadMainDartJs(); |
83 |
| - } |
84 |
| - }); |
85 |
| - |
86 |
| - // If service worker doesn't succeed in a reasonable amount of time, |
87 |
| - // fallback to plaint <script> tag. |
88 |
| - setTimeout(() => { |
89 |
| - if (!scriptLoaded) { |
90 |
| - console.warn( |
91 |
| - '[Amplitude] Failed to load app from service worker. Falling back to plain <script> tag.', |
92 |
| - ); |
93 |
| - loadMainDartJs(); |
94 |
| - } |
95 |
| - }, 4000); |
96 |
| - }); |
97 |
| - } else { |
98 |
| - // Service workers not supported. Just drop the <script> tag. |
99 |
| - loadMainDartJs(); |
100 |
| - } |
| 35 | + <script src="flutter_bootstrap.js" async></script> |
| 36 | + <script type="text/javascript"> |
| 37 | + !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},o=function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};o(e,t,Array.prototype.slice.call(arguments))}},a=function(e){for(var t=0;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var c=t.createElement("script");c.type="text/javascript",c.integrity="sha384-R0H1kXlk6r2aEQMtwVcPolpk0NAuIqM/8NlxAv24Gr3/PBJPl+9elu0bc3o/FDjR",c.crossOrigin="anonymous",c.async=!0,c.src="https://cdn.amplitude.com/libs/analytics-browser-2.11.10-min.js.gz",c.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var l=t.getElementsByTagName("script")[0];l.parentNode.insertBefore(c,l);for(var u=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<p.length;d++)n(u,p[d]);r.Identify=u;for(var f=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],y=0;y<v.length;y++)n(f,v[y]);r.Revenue=f;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(r),r.createInstance=function(e){return r._iq[e]={_q:[]},a(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}(); |
101 | 38 | </script>
|
102 | 39 | </body>
|
103 | 40 | </html>
|
0 commit comments