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