File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class AnalyticsPlatformImpl extends AnalyticsPlatform {
18
18
NativeContext (
19
19
app: NativeContextApp (
20
20
name: web.window.navigator.appName,
21
- version: web.window.navigator.appVersion ,
21
+ version: getAppVersion () ,
22
22
namespace: web.window.navigator.appCodeName,
23
23
),
24
24
userAgent: web.window.navigator.userAgent,
@@ -28,6 +28,16 @@ class AnalyticsPlatformImpl extends AnalyticsPlatform {
28
28
width: web.window.screen.width,
29
29
),
30
30
);
31
+
32
+ /*
33
+ - Checks for <meta name="app-version" content="1.2.3"> in <root>/web/index.html
34
+ and return the value inside 'content'
35
+ - Returns the browser version as fallback
36
+ */
37
+ String getAppVersion () {
38
+ final meta = web.document.querySelector ('meta[name="app-version"]' );
39
+ return meta? .getAttribute ('content' ) ?? web.window.navigator.appVersion;
40
+ }
31
41
}
32
42
33
43
class AnalyticsWeb {
You can’t perform that action at this time.
0 commit comments