@snowplow/react-native-tracker 4.0.2-dev.0 → 4.1.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +38 -30
  2. package/dist/commonjs/constants.js +20 -0
  3. package/dist/commonjs/constants.js.map +1 -0
  4. package/dist/commonjs/event_store.js +150 -0
  5. package/dist/commonjs/event_store.js.map +1 -0
  6. package/dist/commonjs/events.js +42 -0
  7. package/dist/commonjs/events.js.map +1 -0
  8. package/dist/commonjs/index.js +29 -0
  9. package/dist/commonjs/index.js.map +1 -0
  10. package/dist/commonjs/plugins/app_context/index.js +47 -0
  11. package/dist/commonjs/plugins/app_context/index.js.map +1 -0
  12. package/dist/commonjs/plugins/app_install/index.js +60 -0
  13. package/dist/commonjs/plugins/app_install/index.js.map +1 -0
  14. package/dist/commonjs/plugins/app_lifecycle/index.js +126 -0
  15. package/dist/commonjs/plugins/app_lifecycle/index.js.map +1 -0
  16. package/dist/commonjs/plugins/deep_links/index.js +64 -0
  17. package/dist/commonjs/plugins/deep_links/index.js.map +1 -0
  18. package/dist/commonjs/plugins/platform_context/index.js +749 -0
  19. package/dist/commonjs/plugins/platform_context/index.js.map +1 -0
  20. package/dist/commonjs/plugins/session/index.js +197 -0
  21. package/dist/commonjs/plugins/session/index.js.map +1 -0
  22. package/dist/commonjs/plugins.js +147 -0
  23. package/dist/commonjs/plugins.js.map +1 -0
  24. package/dist/commonjs/subject.js +82 -0
  25. package/dist/commonjs/subject.js.map +1 -0
  26. package/dist/commonjs/tracker.js +188 -0
  27. package/dist/commonjs/tracker.js.map +1 -0
  28. package/dist/commonjs/types.js +313 -0
  29. package/dist/commonjs/types.js.map +1 -0
  30. package/dist/commonjs/utils.js +35 -0
  31. package/dist/commonjs/utils.js.map +1 -0
  32. package/dist/module/constants.js +16 -0
  33. package/dist/module/constants.js.map +1 -0
  34. package/dist/module/event_store.js +145 -0
  35. package/dist/module/event_store.js.map +1 -0
  36. package/dist/module/events.js +38 -0
  37. package/dist/module/events.js.map +1 -0
  38. package/dist/module/index.js +7 -0
  39. package/dist/module/index.js.map +1 -0
  40. package/dist/module/plugins/app_context/index.js +44 -0
  41. package/dist/module/plugins/app_context/index.js.map +1 -0
  42. package/dist/module/plugins/app_install/index.js +56 -0
  43. package/dist/module/plugins/app_install/index.js.map +1 -0
  44. package/dist/module/plugins/app_lifecycle/index.js +122 -0
  45. package/dist/module/plugins/app_lifecycle/index.js.map +1 -0
  46. package/dist/module/plugins/deep_links/index.js +60 -0
  47. package/dist/module/plugins/deep_links/index.js.map +1 -0
  48. package/dist/module/plugins/platform_context/index.js +745 -0
  49. package/dist/module/plugins/platform_context/index.js.map +1 -0
  50. package/dist/module/plugins/session/index.js +192 -0
  51. package/dist/module/plugins/session/index.js.map +1 -0
  52. package/dist/module/plugins.js +143 -0
  53. package/dist/module/plugins.js.map +1 -0
  54. package/dist/module/subject.js +78 -0
  55. package/dist/module/subject.js.map +1 -0
  56. package/dist/module/tracker.js +183 -0
  57. package/dist/module/tracker.js.map +1 -0
  58. package/dist/module/types.js +113 -0
  59. package/dist/module/types.js.map +1 -0
  60. package/dist/module/utils.js +31 -0
  61. package/dist/module/utils.js.map +1 -0
  62. package/dist/typescript/commonjs/package.json +1 -0
  63. package/dist/typescript/commonjs/src/constants.d.ts +14 -0
  64. package/dist/typescript/commonjs/src/constants.d.ts.map +1 -0
  65. package/dist/typescript/commonjs/src/event_store.d.ts +4 -0
  66. package/dist/typescript/commonjs/src/event_store.d.ts.map +1 -0
  67. package/dist/typescript/commonjs/src/events.d.ts +10 -0
  68. package/dist/typescript/commonjs/src/events.d.ts.map +1 -0
  69. package/dist/typescript/commonjs/src/index.d.ts +4 -0
  70. package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
  71. package/dist/typescript/commonjs/src/plugins/app_context/index.d.ts +11 -0
  72. package/dist/typescript/commonjs/src/plugins/app_context/index.d.ts.map +1 -0
  73. package/dist/typescript/commonjs/src/plugins/app_install/index.d.ts +10 -0
  74. package/dist/typescript/commonjs/src/plugins/app_install/index.d.ts.map +1 -0
  75. package/dist/typescript/commonjs/src/plugins/app_lifecycle/index.d.ts +13 -0
  76. package/dist/typescript/commonjs/src/plugins/app_lifecycle/index.d.ts.map +1 -0
  77. package/dist/typescript/commonjs/src/plugins/deep_links/index.d.ts +8 -0
  78. package/dist/typescript/commonjs/src/plugins/deep_links/index.d.ts.map +1 -0
  79. package/dist/typescript/commonjs/src/plugins/platform_context/index.d.ts +12 -0
  80. package/dist/typescript/commonjs/src/plugins/platform_context/index.d.ts.map +1 -0
  81. package/dist/typescript/commonjs/src/plugins/session/index.d.ts +19 -0
  82. package/dist/typescript/commonjs/src/plugins/session/index.d.ts.map +1 -0
  83. package/dist/typescript/commonjs/src/plugins.d.ts +6 -0
  84. package/dist/typescript/commonjs/src/plugins.d.ts.map +1 -0
  85. package/dist/typescript/commonjs/src/subject.d.ts +19 -0
  86. package/dist/typescript/commonjs/src/subject.d.ts.map +1 -0
  87. package/dist/typescript/commonjs/src/tracker.d.ts +28 -0
  88. package/dist/typescript/commonjs/src/tracker.d.ts.map +1 -0
  89. package/dist/typescript/commonjs/src/types.d.ts +784 -0
  90. package/dist/typescript/commonjs/src/types.d.ts.map +1 -0
  91. package/dist/typescript/commonjs/src/utils.d.ts +3 -0
  92. package/dist/typescript/commonjs/src/utils.d.ts.map +1 -0
  93. package/dist/typescript/module/package.json +1 -0
  94. package/dist/typescript/module/src/constants.d.ts +14 -0
  95. package/dist/typescript/module/src/constants.d.ts.map +1 -0
  96. package/dist/typescript/module/src/event_store.d.ts +4 -0
  97. package/dist/typescript/module/src/event_store.d.ts.map +1 -0
  98. package/dist/typescript/module/src/events.d.ts +10 -0
  99. package/dist/typescript/module/src/events.d.ts.map +1 -0
  100. package/dist/typescript/module/src/index.d.ts +4 -0
  101. package/dist/typescript/module/src/index.d.ts.map +1 -0
  102. package/dist/typescript/module/src/plugins/app_context/index.d.ts +11 -0
  103. package/dist/typescript/module/src/plugins/app_context/index.d.ts.map +1 -0
  104. package/dist/typescript/module/src/plugins/app_install/index.d.ts +10 -0
  105. package/dist/typescript/module/src/plugins/app_install/index.d.ts.map +1 -0
  106. package/dist/typescript/module/src/plugins/app_lifecycle/index.d.ts +13 -0
  107. package/dist/typescript/module/src/plugins/app_lifecycle/index.d.ts.map +1 -0
  108. package/dist/typescript/module/src/plugins/deep_links/index.d.ts +8 -0
  109. package/dist/typescript/module/src/plugins/deep_links/index.d.ts.map +1 -0
  110. package/dist/typescript/module/src/plugins/platform_context/index.d.ts +12 -0
  111. package/dist/typescript/module/src/plugins/platform_context/index.d.ts.map +1 -0
  112. package/dist/typescript/module/src/plugins/session/index.d.ts +19 -0
  113. package/dist/typescript/module/src/plugins/session/index.d.ts.map +1 -0
  114. package/dist/typescript/module/src/plugins.d.ts +6 -0
  115. package/dist/typescript/module/src/plugins.d.ts.map +1 -0
  116. package/dist/typescript/module/src/subject.d.ts +19 -0
  117. package/dist/typescript/module/src/subject.d.ts.map +1 -0
  118. package/dist/typescript/module/src/tracker.d.ts +28 -0
  119. package/dist/typescript/module/src/tracker.d.ts.map +1 -0
  120. package/dist/typescript/module/src/types.d.ts +784 -0
  121. package/dist/typescript/module/src/types.d.ts.map +1 -0
  122. package/dist/typescript/module/src/utils.d.ts +3 -0
  123. package/dist/typescript/module/src/utils.d.ts.map +1 -0
  124. package/package.json +57 -14
  125. package/dist/index.cjs.d.ts +0 -499
  126. package/dist/index.cjs.js +0 -2656
  127. package/dist/index.cjs.js.map +0 -1
  128. package/dist/index.cjs.min.d.ts +0 -499
  129. package/dist/index.cjs.min.js +0 -63
  130. package/dist/index.cjs.min.js.map +0 -1
  131. package/dist/index.module.d.ts +0 -499
  132. package/dist/index.module.js +0 -250
  133. package/dist/index.module.js.map +0 -1
@@ -0,0 +1,749 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.newPlatformContextPlugin = newPlatformContextPlugin;
7
+ var _types = require("../../types.js");
8
+ var _constants = require("../../constants.js");
9
+ var _reactNative = require("react-native");
10
+ var _trackerCore = require("@snowplow/tracker-core");
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
13
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
14
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
15
+ function getIOSConstants() {
16
+ var _NativeModules$Settin, _NativeModules$Settin2;
17
+ // Example Platform info on iOS:
18
+ // {
19
+ // "OS": "ios",
20
+ // "Version": "18.0",
21
+ // "constants": {
22
+ // "forceTouchAvailable": false,
23
+ // "interfaceIdiom": "phone",
24
+ // "isMacCatalyst": false,
25
+ // "isTesting": false,
26
+ // "osVersion": "18.0",
27
+ // "systemName": "iOS"
28
+ // },
29
+ // "isMacCatalyst": false,
30
+ // "isPad": false,
31
+ // "isTV": false,
32
+ // "isVision": false
33
+ // }
34
+
35
+ // Example NativeModules.SettingsManager?.settings info on iOS:
36
+ // {
37
+ // "AppleLanguages": [
38
+ // "en-GB"
39
+ // ],
40
+ // "AppleLocale": "en_GB"
41
+ // }
42
+
43
+ var constants = _reactNative.Platform.constants;
44
+ return {
45
+ osType: constants.systemName,
46
+ deviceManufacturer: 'Apple',
47
+ osVersion: constants.osVersion,
48
+ deviceModel: _reactNative.Platform.isPad ? 'iPad' : _reactNative.Platform.isTV ? 'Apple TV' : _reactNative.Platform.isVision ? 'Vision' : _reactNative.Platform.isMacCatalyst ? 'Mac' : 'iPhone',
49
+ language: ((_NativeModules$Settin = _reactNative.NativeModules.SettingsManager) === null || _NativeModules$Settin === void 0 || (_NativeModules$Settin = _NativeModules$Settin.settings) === null || _NativeModules$Settin === void 0 ? void 0 : _NativeModules$Settin.AppleLocale) || ((_NativeModules$Settin2 = _reactNative.NativeModules.SettingsManager) === null || _NativeModules$Settin2 === void 0 || (_NativeModules$Settin2 = _NativeModules$Settin2.settings) === null || _NativeModules$Settin2 === void 0 ? void 0 : _NativeModules$Settin2.AppleLanguages[0]) //iOS 13
50
+ };
51
+ }
52
+ function getAndroidConstants() {
53
+ var _NativeModules$I18nMa;
54
+ // Example Platform info on Android:
55
+ // {
56
+ // "OS": "android",
57
+ // "Version": 33,
58
+ // "constants": {
59
+ // "Brand": "google",
60
+ // "Manufacturer": "Google",
61
+ // "Model": "sdk_gphone64_arm64",
62
+ // "Release": "13",
63
+ // "Version": 33,
64
+ // },
65
+ // }
66
+
67
+ // Example NativeModules.I18nManager info on Android:
68
+ // { "localeIdentifier": "en_US" }
69
+ var constants = _reactNative.Platform.constants;
70
+ return {
71
+ osType: 'Android',
72
+ deviceManufacturer: constants.Manufacturer,
73
+ osVersion: String(constants.Version),
74
+ deviceModel: constants.Model,
75
+ language: (_NativeModules$I18nMa = _reactNative.NativeModules.I18nManager) === null || _NativeModules$I18nMa === void 0 ? void 0 : _NativeModules$I18nMa.localeIdentifier
76
+ };
77
+ }
78
+
79
+ /**
80
+ * Tracks a mobile_context entity with all events if platformContext is enabled.
81
+ */
82
+ function newPlatformContextPlugin() {
83
+ return _newPlatformContextPlugin.apply(this, arguments);
84
+ }
85
+ function _newPlatformContextPlugin() {
86
+ _newPlatformContextPlugin = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
87
+ var _ref,
88
+ _ref$platformContext,
89
+ platformContext,
90
+ platformContextProperties,
91
+ platformContextRetriever,
92
+ deviceModel,
93
+ osType,
94
+ deviceManufacturer,
95
+ osVersion,
96
+ carrier,
97
+ networkType,
98
+ networkTechnology,
99
+ appleIdfa,
100
+ appleIdfv,
101
+ androidIdfa,
102
+ physicalMemory,
103
+ systemAvailableMemory,
104
+ appAvailableMemory,
105
+ batteryLevel,
106
+ batteryState,
107
+ lowPowerMode,
108
+ availableStorage,
109
+ totalStorage,
110
+ isPortrait,
111
+ resolution,
112
+ scale,
113
+ language,
114
+ appSetId,
115
+ appSetIdScope,
116
+ refreshPlatformContext,
117
+ enablePlatformContext,
118
+ disablePlatformContext,
119
+ contexts,
120
+ _args3 = arguments;
121
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
122
+ while (1) switch (_context3.prev = _context3.next) {
123
+ case 0:
124
+ _ref = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, _ref$platformContext = _ref.platformContext, platformContext = _ref$platformContext === void 0 ? true : _ref$platformContext, platformContextProperties = _ref.platformContextProperties, platformContextRetriever = _ref.platformContextRetriever;
125
+ refreshPlatformContext = /*#__PURE__*/function () {
126
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
127
+ var _platformContextPrope, _platformContextPrope2, _platformContextPrope3, _platformContextPrope4, _platformContextPrope5, _platformContextPrope6, _platformContextPrope7, _platformContextPrope8, _platformContextPrope9, _platformContextPrope10, _platformContextPrope11, _platformContextPrope12, _platformContextPrope13, _platformContextPrope14, _platformContextPrope15, _platformContextPrope16, _platformContextPrope17, _platformContextPrope18, _platformContextPrope19;
128
+ var constants;
129
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
130
+ while (1) switch (_context.prev = _context.next) {
131
+ case 0:
132
+ constants = _reactNative.Platform.OS === 'ios' ? getIOSConstants() : _reactNative.Platform.OS == 'android' ? getAndroidConstants() : undefined;
133
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getDeviceModel)) {
134
+ _context.next = 7;
135
+ break;
136
+ }
137
+ _context.next = 4;
138
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getDeviceModel();
139
+ case 4:
140
+ _context.t0 = _context.sent;
141
+ _context.next = 8;
142
+ break;
143
+ case 7:
144
+ _context.t0 = constants === null || constants === void 0 ? void 0 : constants.deviceModel;
145
+ case 8:
146
+ deviceModel = _context.t0;
147
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getOsType)) {
148
+ _context.next = 15;
149
+ break;
150
+ }
151
+ _context.next = 12;
152
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getOsType();
153
+ case 12:
154
+ _context.t1 = _context.sent;
155
+ _context.next = 16;
156
+ break;
157
+ case 15:
158
+ _context.t1 = constants === null || constants === void 0 ? void 0 : constants.osType;
159
+ case 16:
160
+ osType = _context.t1;
161
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getDeviceManufacturer)) {
162
+ _context.next = 23;
163
+ break;
164
+ }
165
+ _context.next = 20;
166
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getDeviceManufacturer();
167
+ case 20:
168
+ _context.t2 = _context.sent;
169
+ _context.next = 24;
170
+ break;
171
+ case 23:
172
+ _context.t2 = constants === null || constants === void 0 ? void 0 : constants.deviceManufacturer;
173
+ case 24:
174
+ deviceManufacturer = _context.t2;
175
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getOsVersion)) {
176
+ _context.next = 31;
177
+ break;
178
+ }
179
+ _context.next = 28;
180
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getOsVersion();
181
+ case 28:
182
+ _context.t3 = _context.sent;
183
+ _context.next = 32;
184
+ break;
185
+ case 31:
186
+ _context.t3 = constants === null || constants === void 0 ? void 0 : constants.osVersion;
187
+ case 32:
188
+ osVersion = _context.t3;
189
+ if (!((_platformContextPrope = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.Carrier)) !== null && _platformContextPrope !== void 0 ? _platformContextPrope : true)) {
190
+ _context.next = 44;
191
+ break;
192
+ }
193
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getCarrier)) {
194
+ _context.next = 40;
195
+ break;
196
+ }
197
+ _context.next = 37;
198
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getCarrier();
199
+ case 37:
200
+ _context.t5 = _context.sent;
201
+ _context.next = 41;
202
+ break;
203
+ case 40:
204
+ _context.t5 = undefined;
205
+ case 41:
206
+ _context.t4 = _context.t5;
207
+ _context.next = 45;
208
+ break;
209
+ case 44:
210
+ _context.t4 = undefined;
211
+ case 45:
212
+ carrier = _context.t4;
213
+ if (!((_platformContextPrope2 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.NetworkType)) !== null && _platformContextPrope2 !== void 0 ? _platformContextPrope2 : true)) {
214
+ _context.next = 57;
215
+ break;
216
+ }
217
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getNetworkType)) {
218
+ _context.next = 53;
219
+ break;
220
+ }
221
+ _context.next = 50;
222
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getNetworkType();
223
+ case 50:
224
+ _context.t7 = _context.sent;
225
+ _context.next = 54;
226
+ break;
227
+ case 53:
228
+ _context.t7 = undefined;
229
+ case 54:
230
+ _context.t6 = _context.t7;
231
+ _context.next = 58;
232
+ break;
233
+ case 57:
234
+ _context.t6 = undefined;
235
+ case 58:
236
+ networkType = _context.t6;
237
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getNetworkTechnology)) {
238
+ _context.next = 65;
239
+ break;
240
+ }
241
+ _context.next = 62;
242
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getNetworkTechnology();
243
+ case 62:
244
+ _context.t8 = _context.sent;
245
+ _context.next = 66;
246
+ break;
247
+ case 65:
248
+ _context.t8 = undefined;
249
+ case 66:
250
+ networkTechnology = _context.t8;
251
+ if (!((_platformContextPrope3 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AppleIdfa)) !== null && _platformContextPrope3 !== void 0 ? _platformContextPrope3 : true)) {
252
+ _context.next = 78;
253
+ break;
254
+ }
255
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAppleIdfa)) {
256
+ _context.next = 74;
257
+ break;
258
+ }
259
+ _context.next = 71;
260
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAppleIdfa();
261
+ case 71:
262
+ _context.t10 = _context.sent;
263
+ _context.next = 75;
264
+ break;
265
+ case 74:
266
+ _context.t10 = undefined;
267
+ case 75:
268
+ _context.t9 = _context.t10;
269
+ _context.next = 79;
270
+ break;
271
+ case 78:
272
+ _context.t9 = undefined;
273
+ case 79:
274
+ appleIdfa = _context.t9;
275
+ if (!((_platformContextPrope4 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AppleIdfv)) !== null && _platformContextPrope4 !== void 0 ? _platformContextPrope4 : true)) {
276
+ _context.next = 91;
277
+ break;
278
+ }
279
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAppleIdfv)) {
280
+ _context.next = 87;
281
+ break;
282
+ }
283
+ _context.next = 84;
284
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAppleIdfv();
285
+ case 84:
286
+ _context.t12 = _context.sent;
287
+ _context.next = 88;
288
+ break;
289
+ case 87:
290
+ _context.t12 = undefined;
291
+ case 88:
292
+ _context.t11 = _context.t12;
293
+ _context.next = 92;
294
+ break;
295
+ case 91:
296
+ _context.t11 = undefined;
297
+ case 92:
298
+ appleIdfv = _context.t11;
299
+ if (!((_platformContextPrope5 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AndroidIdfa)) !== null && _platformContextPrope5 !== void 0 ? _platformContextPrope5 : true)) {
300
+ _context.next = 104;
301
+ break;
302
+ }
303
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAndroidIdfa)) {
304
+ _context.next = 100;
305
+ break;
306
+ }
307
+ _context.next = 97;
308
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAndroidIdfa();
309
+ case 97:
310
+ _context.t14 = _context.sent;
311
+ _context.next = 101;
312
+ break;
313
+ case 100:
314
+ _context.t14 = undefined;
315
+ case 101:
316
+ _context.t13 = _context.t14;
317
+ _context.next = 105;
318
+ break;
319
+ case 104:
320
+ _context.t13 = undefined;
321
+ case 105:
322
+ androidIdfa = _context.t13;
323
+ if (!((_platformContextPrope6 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.PhysicalMemory)) !== null && _platformContextPrope6 !== void 0 ? _platformContextPrope6 : true)) {
324
+ _context.next = 117;
325
+ break;
326
+ }
327
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getPhysicalMemory)) {
328
+ _context.next = 113;
329
+ break;
330
+ }
331
+ _context.next = 110;
332
+ return platformContextRetriever.getPhysicalMemory();
333
+ case 110:
334
+ _context.t16 = _context.sent;
335
+ _context.next = 114;
336
+ break;
337
+ case 113:
338
+ _context.t16 = undefined;
339
+ case 114:
340
+ _context.t15 = _context.t16;
341
+ _context.next = 118;
342
+ break;
343
+ case 117:
344
+ _context.t15 = undefined;
345
+ case 118:
346
+ physicalMemory = _context.t15;
347
+ if (!((_platformContextPrope7 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.SystemAvailableMemory)) !== null && _platformContextPrope7 !== void 0 ? _platformContextPrope7 : true)) {
348
+ _context.next = 130;
349
+ break;
350
+ }
351
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getSystemAvailableMemory)) {
352
+ _context.next = 126;
353
+ break;
354
+ }
355
+ _context.next = 123;
356
+ return platformContextRetriever.getSystemAvailableMemory();
357
+ case 123:
358
+ _context.t18 = _context.sent;
359
+ _context.next = 127;
360
+ break;
361
+ case 126:
362
+ _context.t18 = undefined;
363
+ case 127:
364
+ _context.t17 = _context.t18;
365
+ _context.next = 131;
366
+ break;
367
+ case 130:
368
+ _context.t17 = undefined;
369
+ case 131:
370
+ systemAvailableMemory = _context.t17;
371
+ if (!((_platformContextPrope8 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AppAvailableMemory)) !== null && _platformContextPrope8 !== void 0 ? _platformContextPrope8 : true)) {
372
+ _context.next = 143;
373
+ break;
374
+ }
375
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAppAvailableMemory)) {
376
+ _context.next = 139;
377
+ break;
378
+ }
379
+ _context.next = 136;
380
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAppAvailableMemory();
381
+ case 136:
382
+ _context.t20 = _context.sent;
383
+ _context.next = 140;
384
+ break;
385
+ case 139:
386
+ _context.t20 = undefined;
387
+ case 140:
388
+ _context.t19 = _context.t20;
389
+ _context.next = 144;
390
+ break;
391
+ case 143:
392
+ _context.t19 = undefined;
393
+ case 144:
394
+ appAvailableMemory = _context.t19;
395
+ if (!((_platformContextPrope9 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.BatteryLevel)) !== null && _platformContextPrope9 !== void 0 ? _platformContextPrope9 : true)) {
396
+ _context.next = 156;
397
+ break;
398
+ }
399
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getBatteryLevel)) {
400
+ _context.next = 152;
401
+ break;
402
+ }
403
+ _context.next = 149;
404
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getBatteryLevel();
405
+ case 149:
406
+ _context.t22 = _context.sent;
407
+ _context.next = 153;
408
+ break;
409
+ case 152:
410
+ _context.t22 = undefined;
411
+ case 153:
412
+ _context.t21 = _context.t22;
413
+ _context.next = 157;
414
+ break;
415
+ case 156:
416
+ _context.t21 = undefined;
417
+ case 157:
418
+ batteryLevel = _context.t21;
419
+ if (!((_platformContextPrope10 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.BatteryState)) !== null && _platformContextPrope10 !== void 0 ? _platformContextPrope10 : true)) {
420
+ _context.next = 169;
421
+ break;
422
+ }
423
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getBatteryState)) {
424
+ _context.next = 165;
425
+ break;
426
+ }
427
+ _context.next = 162;
428
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getBatteryState();
429
+ case 162:
430
+ _context.t24 = _context.sent;
431
+ _context.next = 166;
432
+ break;
433
+ case 165:
434
+ _context.t24 = undefined;
435
+ case 166:
436
+ _context.t23 = _context.t24;
437
+ _context.next = 170;
438
+ break;
439
+ case 169:
440
+ _context.t23 = undefined;
441
+ case 170:
442
+ batteryState = _context.t23;
443
+ if (!((_platformContextPrope11 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.LowPowerMode)) !== null && _platformContextPrope11 !== void 0 ? _platformContextPrope11 : true)) {
444
+ _context.next = 182;
445
+ break;
446
+ }
447
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getLowPowerMode)) {
448
+ _context.next = 178;
449
+ break;
450
+ }
451
+ _context.next = 175;
452
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getLowPowerMode();
453
+ case 175:
454
+ _context.t26 = _context.sent;
455
+ _context.next = 179;
456
+ break;
457
+ case 178:
458
+ _context.t26 = undefined;
459
+ case 179:
460
+ _context.t25 = _context.t26;
461
+ _context.next = 183;
462
+ break;
463
+ case 182:
464
+ _context.t25 = undefined;
465
+ case 183:
466
+ lowPowerMode = _context.t25;
467
+ if (!((_platformContextPrope12 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AvailableStorage)) !== null && _platformContextPrope12 !== void 0 ? _platformContextPrope12 : true)) {
468
+ _context.next = 195;
469
+ break;
470
+ }
471
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAvailableStorage)) {
472
+ _context.next = 191;
473
+ break;
474
+ }
475
+ _context.next = 188;
476
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAvailableStorage();
477
+ case 188:
478
+ _context.t28 = _context.sent;
479
+ _context.next = 192;
480
+ break;
481
+ case 191:
482
+ _context.t28 = undefined;
483
+ case 192:
484
+ _context.t27 = _context.t28;
485
+ _context.next = 196;
486
+ break;
487
+ case 195:
488
+ _context.t27 = undefined;
489
+ case 196:
490
+ availableStorage = _context.t27;
491
+ if (!((_platformContextPrope13 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.TotalStorage)) !== null && _platformContextPrope13 !== void 0 ? _platformContextPrope13 : true)) {
492
+ _context.next = 208;
493
+ break;
494
+ }
495
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getTotalStorage)) {
496
+ _context.next = 204;
497
+ break;
498
+ }
499
+ _context.next = 201;
500
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getTotalStorage();
501
+ case 201:
502
+ _context.t30 = _context.sent;
503
+ _context.next = 205;
504
+ break;
505
+ case 204:
506
+ _context.t30 = undefined;
507
+ case 205:
508
+ _context.t29 = _context.t30;
509
+ _context.next = 209;
510
+ break;
511
+ case 208:
512
+ _context.t29 = undefined;
513
+ case 209:
514
+ totalStorage = _context.t29;
515
+ if (!((_platformContextPrope14 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.IsPortrait)) !== null && _platformContextPrope14 !== void 0 ? _platformContextPrope14 : true)) {
516
+ _context.next = 221;
517
+ break;
518
+ }
519
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.isPortrait)) {
520
+ _context.next = 217;
521
+ break;
522
+ }
523
+ _context.next = 214;
524
+ return platformContextRetriever.isPortrait();
525
+ case 214:
526
+ _context.t32 = _context.sent;
527
+ _context.next = 218;
528
+ break;
529
+ case 217:
530
+ _context.t32 = undefined;
531
+ case 218:
532
+ _context.t31 = _context.t32;
533
+ _context.next = 222;
534
+ break;
535
+ case 221:
536
+ _context.t31 = undefined;
537
+ case 222:
538
+ isPortrait = _context.t31;
539
+ if (!((_platformContextPrope15 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.Resolution)) !== null && _platformContextPrope15 !== void 0 ? _platformContextPrope15 : true)) {
540
+ _context.next = 234;
541
+ break;
542
+ }
543
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getResolution)) {
544
+ _context.next = 230;
545
+ break;
546
+ }
547
+ _context.next = 227;
548
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getResolution();
549
+ case 227:
550
+ _context.t34 = _context.sent;
551
+ _context.next = 231;
552
+ break;
553
+ case 230:
554
+ _context.t34 = _reactNative.Dimensions.get('window').width + 'x' + _reactNative.Dimensions.get('window').height;
555
+ case 231:
556
+ _context.t33 = _context.t34;
557
+ _context.next = 235;
558
+ break;
559
+ case 234:
560
+ _context.t33 = undefined;
561
+ case 235:
562
+ resolution = _context.t33;
563
+ if (!((_platformContextPrope16 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.Scale)) !== null && _platformContextPrope16 !== void 0 ? _platformContextPrope16 : true)) {
564
+ _context.next = 247;
565
+ break;
566
+ }
567
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getScale)) {
568
+ _context.next = 243;
569
+ break;
570
+ }
571
+ _context.next = 240;
572
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getScale();
573
+ case 240:
574
+ _context.t36 = _context.sent;
575
+ _context.next = 244;
576
+ break;
577
+ case 243:
578
+ _context.t36 = _reactNative.PixelRatio.get();
579
+ case 244:
580
+ _context.t35 = _context.t36;
581
+ _context.next = 248;
582
+ break;
583
+ case 247:
584
+ _context.t35 = undefined;
585
+ case 248:
586
+ scale = _context.t35;
587
+ if (!((_platformContextPrope17 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.Language)) !== null && _platformContextPrope17 !== void 0 ? _platformContextPrope17 : true)) {
588
+ _context.next = 260;
589
+ break;
590
+ }
591
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getLanguage)) {
592
+ _context.next = 256;
593
+ break;
594
+ }
595
+ _context.next = 253;
596
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getLanguage();
597
+ case 253:
598
+ _context.t38 = _context.sent;
599
+ _context.next = 257;
600
+ break;
601
+ case 256:
602
+ _context.t38 = constants === null || constants === void 0 ? void 0 : constants.language;
603
+ case 257:
604
+ _context.t37 = _context.t38;
605
+ _context.next = 261;
606
+ break;
607
+ case 260:
608
+ _context.t37 = undefined;
609
+ case 261:
610
+ language = _context.t37;
611
+ if (!((_platformContextPrope18 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AppSetId)) !== null && _platformContextPrope18 !== void 0 ? _platformContextPrope18 : true)) {
612
+ _context.next = 273;
613
+ break;
614
+ }
615
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAppSetId)) {
616
+ _context.next = 269;
617
+ break;
618
+ }
619
+ _context.next = 266;
620
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAppSetId();
621
+ case 266:
622
+ _context.t40 = _context.sent;
623
+ _context.next = 270;
624
+ break;
625
+ case 269:
626
+ _context.t40 = undefined;
627
+ case 270:
628
+ _context.t39 = _context.t40;
629
+ _context.next = 274;
630
+ break;
631
+ case 273:
632
+ _context.t39 = undefined;
633
+ case 274:
634
+ appSetId = _context.t39;
635
+ if (!((_platformContextPrope19 = platformContextProperties === null || platformContextProperties === void 0 ? void 0 : platformContextProperties.includes(_types.PlatformContextProperty.AppSetIdScope)) !== null && _platformContextPrope19 !== void 0 ? _platformContextPrope19 : true)) {
636
+ _context.next = 286;
637
+ break;
638
+ }
639
+ if (!(platformContextRetriever !== null && platformContextRetriever !== void 0 && platformContextRetriever.getAppSetIdScope)) {
640
+ _context.next = 282;
641
+ break;
642
+ }
643
+ _context.next = 279;
644
+ return platformContextRetriever === null || platformContextRetriever === void 0 ? void 0 : platformContextRetriever.getAppSetIdScope();
645
+ case 279:
646
+ _context.t42 = _context.sent;
647
+ _context.next = 283;
648
+ break;
649
+ case 282:
650
+ _context.t42 = undefined;
651
+ case 283:
652
+ _context.t41 = _context.t42;
653
+ _context.next = 287;
654
+ break;
655
+ case 286:
656
+ _context.t41 = undefined;
657
+ case 287:
658
+ appSetIdScope = _context.t41;
659
+ case 288:
660
+ case "end":
661
+ return _context.stop();
662
+ }
663
+ }, _callee);
664
+ }));
665
+ return function refreshPlatformContext() {
666
+ return _ref2.apply(this, arguments);
667
+ };
668
+ }();
669
+ enablePlatformContext = /*#__PURE__*/function () {
670
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
671
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
672
+ while (1) switch (_context2.prev = _context2.next) {
673
+ case 0:
674
+ platformContext = true;
675
+ _context2.next = 3;
676
+ return refreshPlatformContext();
677
+ case 3:
678
+ case "end":
679
+ return _context2.stop();
680
+ }
681
+ }, _callee2);
682
+ }));
683
+ return function enablePlatformContext() {
684
+ return _ref3.apply(this, arguments);
685
+ };
686
+ }();
687
+ disablePlatformContext = function disablePlatformContext() {
688
+ platformContext = false;
689
+ };
690
+ if (!platformContext) {
691
+ _context3.next = 7;
692
+ break;
693
+ }
694
+ _context3.next = 7;
695
+ return refreshPlatformContext();
696
+ case 7:
697
+ contexts = function contexts() {
698
+ // check required properties
699
+ if (platformContext && osType !== undefined && osVersion !== undefined && deviceManufacturer !== undefined && deviceModel !== undefined) {
700
+ return [{
701
+ schema: _constants.MOBILE_CONTEXT_SCHEMA,
702
+ data: (0, _trackerCore.removeEmptyProperties)({
703
+ osType: osType,
704
+ osVersion: osVersion,
705
+ deviceManufacturer: deviceManufacturer,
706
+ deviceModel: deviceModel,
707
+ carrier: carrier,
708
+ networkType: networkType,
709
+ networkTechnology: networkTechnology,
710
+ appleIdfa: appleIdfa,
711
+ appleIdfv: appleIdfv,
712
+ androidIdfa: androidIdfa,
713
+ physicalMemory: physicalMemory,
714
+ systemAvailableMemory: systemAvailableMemory,
715
+ appAvailableMemory: appAvailableMemory,
716
+ batteryLevel: batteryLevel,
717
+ batteryState: batteryState,
718
+ lowPowerMode: lowPowerMode,
719
+ availableStorage: availableStorage,
720
+ totalStorage: totalStorage,
721
+ isPortrait: isPortrait,
722
+ resolution: resolution,
723
+ scale: scale,
724
+ language: language,
725
+ appSetId: appSetId,
726
+ appSetIdScope: appSetIdScope
727
+ })
728
+ }];
729
+ } else {
730
+ return [];
731
+ }
732
+ };
733
+ return _context3.abrupt("return", {
734
+ enablePlatformContext: enablePlatformContext,
735
+ disablePlatformContext: disablePlatformContext,
736
+ refreshPlatformContext: refreshPlatformContext,
737
+ plugin: {
738
+ contexts: contexts
739
+ }
740
+ });
741
+ case 9:
742
+ case "end":
743
+ return _context3.stop();
744
+ }
745
+ }, _callee3);
746
+ }));
747
+ return _newPlatformContextPlugin.apply(this, arguments);
748
+ }
749
+ //# sourceMappingURL=index.js.map