natively 2.15.2 → 2.15.4

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.
@@ -19,4 +19,21 @@ export declare class Natively {
19
19
  shareTextAndImage(text: string, image_url: string): void;
20
20
  shareFile(file_url: string): void;
21
21
  openExternalURL(url?: string, external?: boolean): void;
22
+ openExternalApp(url: string): void;
23
+ showAppToast(type: string, text?: string): void;
24
+ showAppBanner(type: string, title?: string, description?: string): void;
25
+ requestAppReview(): void;
26
+ setAppBackgroundColor(color: string): void;
27
+ setAppProgressColor(color: string): void;
28
+ setAppSwipeNavigation(toggle: boolean): void;
29
+ setAppPullToRefresh(toggle: boolean): void;
30
+ setAppOrientation(orientation: string): void;
31
+ setAppStatusBarStyle(style: string): void;
32
+ hideLoadingScreen(): void;
33
+ showLoadingScreen(autoHide?: boolean): void;
34
+ openAppSettings(): void;
35
+ hapticPattern(pattern: string, delay: number): void;
36
+ hapticImpact(type: string): void;
37
+ hapticNotification(type: string): void;
38
+ sendPushNotification(appId: string, payload: any, player_ids: string[], isPreview: boolean): Promise<Response>;
22
39
  }
@@ -1,7 +1,9 @@
1
+ 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); }
2
+ 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); }); }; }
1
3
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import globalContext from "../utils/globalThis";
6
+ import globalContext from "../utils/globalThis.js";
5
7
  export class Natively {
6
8
  constructor() {
7
9
  var _globalContext$naviga, _globalContext$naviga2;
@@ -136,4 +138,123 @@ export class Natively {
136
138
  };
137
139
  globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 18, undefined, "open_link", params);
138
140
  }
141
+ openExternalApp(url) {
142
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 22, undefined, "open_app", {
143
+ url
144
+ });
145
+ }
146
+ showAppToast(type, text) {
147
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 0, undefined, "show_toast", {
148
+ text: text || "",
149
+ type: type || "DEFAULT"
150
+ });
151
+ }
152
+ showAppBanner(type, title, description) {
153
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 0, undefined, "show_banner", {
154
+ type: type || "INFO",
155
+ title: title || "",
156
+ description: description || ""
157
+ });
158
+ }
159
+ requestAppReview() {
160
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 0, undefined, "request_review");
161
+ }
162
+ setAppBackgroundColor(color) {
163
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 1, undefined, "app_background", {
164
+ color
165
+ });
166
+ }
167
+ setAppProgressColor(color) {
168
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 1, undefined, "app_progress", {
169
+ color
170
+ });
171
+ }
172
+ setAppSwipeNavigation(toggle) {
173
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 22, undefined, "app_navigation", {
174
+ toggle
175
+ });
176
+ }
177
+ setAppPullToRefresh(toggle) {
178
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 1, undefined, "app_pull", {
179
+ toggle
180
+ });
181
+ }
182
+ setAppOrientation(orientation) {
183
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 3, undefined, "app_orientation", {
184
+ orientation
185
+ });
186
+ }
187
+ setAppStatusBarStyle(style) {
188
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 22, undefined, "status_bar_style", {
189
+ style
190
+ });
191
+ }
192
+ hideLoadingScreen() {
193
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 17, undefined, "loading_screen", {
194
+ show_loader: false,
195
+ auto_hide: true
196
+ });
197
+ }
198
+ showLoadingScreen(autoHide) {
199
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 17, undefined, "loading_screen", {
200
+ show_loader: true,
201
+ auto_hide: autoHide || false
202
+ });
203
+ }
204
+ openAppSettings() {
205
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 0, undefined, "open_appsettings");
206
+ }
207
+ hapticPattern(pattern, delay) {
208
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 22, undefined, "haptic_pattern", {
209
+ pattern,
210
+ delay
211
+ });
212
+ }
213
+ hapticImpact(type) {
214
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 22, undefined, "haptic_impact", {
215
+ type
216
+ });
217
+ }
218
+ hapticNotification(type) {
219
+ globalContext === null || globalContext === void 0 || globalContext.natively.trigger(undefined, 22, undefined, "haptic_notification", {
220
+ type
221
+ });
222
+ }
223
+ sendPushNotification(appId, payload, player_ids, isPreview) {
224
+ return _asyncToGenerator(function* () {
225
+ var filtered = player_ids.filter(id => id.length > 0);
226
+ var include_player_ids = [...new Set(filtered)];
227
+ var notification = {
228
+ app_id: isPreview ? "be83022a-1d08-45d0-a07a-0c3655666e17" // Preview App ID
229
+ : appId,
230
+ include_player_ids
231
+ };
232
+ if (payload.template_id) {
233
+ notification.template_id = payload.template_id;
234
+ } else {
235
+ notification.headings = {
236
+ en: payload.title || "Empty Title"
237
+ };
238
+ notification.contents = {
239
+ en: payload.message || "Empty Message"
240
+ };
241
+ if (payload.subtitle) {
242
+ notification.subtitle = {
243
+ en: payload.subtitle
244
+ };
245
+ }
246
+ if (payload.redirect_url) {
247
+ notification.url = payload.redirect_url;
248
+ }
249
+ }
250
+ var options = {
251
+ method: "POST",
252
+ headers: {
253
+ "Content-type": "application/json"
254
+ },
255
+ body: JSON.stringify(notification)
256
+ };
257
+ return yield fetch("https://onesignal.com/api/v1/notifications", options);
258
+ })();
259
+ }
139
260
  }
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyAdmobBanner {
7
7
  constructor(config, setup_callback) {
8
8
  var _config$position, _config$sizeType, _config$custom_width, _config$custom_height;
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
 
7
7
  /**
8
8
  * @description \>=2.9.0
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyAppleSignInService {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyAudioRecorder {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyBiometrics {
7
7
  constructor(allowPass) {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyCamera {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyClipboard {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyContacts {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyDatePicker {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyFirebaseNotifications {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
 
7
7
  // Legacy use Natively Location
8
8
  export class NativelyGeolocation {
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyHealth {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyInfo {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyLocation {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyMediaPicker {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyMessage {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyNFCService {
7
7
  constructor(readAlertMessage, writeAlertMessage, readDetectedMessage, writeDetectedMessage) {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyNotifications {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyPurchases {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyScanner {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
@@ -1,8 +1,8 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { generateID } from "../utils/generateID";
5
- import globalContext from "../utils/globalThis";
4
+ import { generateID } from "../utils/generateID.js";
5
+ import globalContext from "../utils/globalThis.js";
6
6
  export class NativelyStorage {
7
7
  constructor() {
8
8
  _defineProperty(this, "id", generateID());
package/dist/events.js CHANGED
@@ -1,4 +1,4 @@
1
- import globalContext from "./utils/globalThis";
1
+ import globalContext from "./utils/globalThis.js";
2
2
  globalContext === null || globalContext === void 0 ? void 0 : globalContext.natively.addObserver(() => globalContext === null || globalContext === void 0 ? void 0 : globalContext.natively.trigger(undefined, 0, resp => {
3
3
  if (globalContext) {
4
4
  globalContext.natively.min_app_version = resp.minSDKVersion;
@@ -1,2 +1,2 @@
1
- import globalContext from "../utils/globalThis";
1
+ import globalContext from "../utils/globalThis.js";
2
2
  export var useNatively = () => globalContext === null || globalContext === void 0 ? void 0 : globalContext.natively;
package/dist/index.js CHANGED
@@ -1,32 +1,32 @@
1
1
  // Classes
2
- export { Natively } from "./classes/Natively";
3
- export { NativelyAppleSignInService } from "./classes/NativelyAppleSignInService";
4
- export { NativelyClipboard } from "./classes/NativelyClipboard";
5
- export { NativelyInfo } from "./classes/NativelyInfo";
6
- export { NativelyNotifications } from "./classes/NativelyNotifications";
7
- export { NativelyGeolocation } from "./classes/NativelyGeolocation";
8
- export { NativelyLocation } from "./classes/NativelyLocation";
9
- export { NativelyMessage } from "./classes/NativelyMessage";
10
- export { NativelyStorage } from "./classes/NativelyStorage";
11
- export { NativelyBiometrics } from "./classes/NativelyBiometrics";
12
- export { NativelyDatePicker } from "./classes/NativelyDatePicker";
13
- export { NativelyCamera } from "./classes/NativelyCamera";
14
- export { NativelyHealth } from "./classes/NativelyHealth";
15
- export { NativelyScanner } from "./classes/NativelyScanner";
16
- export { NativelyPurchases } from "./classes/NativelyPurchases";
17
- export { NativelyContacts } from "./classes/NativelyContacts";
18
- export { NativelyMediaPicker } from "./classes/NativelyMediaPicker";
19
- export { NativelyAudioRecorder } from "./classes/NativelyAudioRecorder";
20
- export { NativelyAdmobBanner } from "./classes/NativelyAdmobBanner";
21
- export { NativelyAdmobInterstitial } from "./classes/NativelyAdmobInterstitial";
22
- export { NativelyNFCService } from "./classes/NativelyNFCService";
23
- export { NativelyFirebaseNotifications } from './classes/NativelyFirebaseNotifications';
2
+ export { Natively } from "./classes/Natively.js";
3
+ export { NativelyAppleSignInService } from "./classes/NativelyAppleSignInService.js";
4
+ export { NativelyClipboard } from "./classes/NativelyClipboard.js";
5
+ export { NativelyInfo } from "./classes/NativelyInfo.js";
6
+ export { NativelyNotifications } from "./classes/NativelyNotifications.js";
7
+ export { NativelyGeolocation } from "./classes/NativelyGeolocation.js";
8
+ export { NativelyLocation } from "./classes/NativelyLocation.js";
9
+ export { NativelyMessage } from "./classes/NativelyMessage.js";
10
+ export { NativelyStorage } from "./classes/NativelyStorage.js";
11
+ export { NativelyBiometrics } from "./classes/NativelyBiometrics.js";
12
+ export { NativelyDatePicker } from "./classes/NativelyDatePicker.js";
13
+ export { NativelyCamera } from "./classes/NativelyCamera.js";
14
+ export { NativelyHealth } from "./classes/NativelyHealth.js";
15
+ export { NativelyScanner } from "./classes/NativelyScanner.js";
16
+ export { NativelyPurchases } from "./classes/NativelyPurchases.js";
17
+ export { NativelyContacts } from "./classes/NativelyContacts.js";
18
+ export { NativelyMediaPicker } from "./classes/NativelyMediaPicker.js";
19
+ export { NativelyAudioRecorder } from "./classes/NativelyAudioRecorder.js";
20
+ export { NativelyAdmobBanner } from "./classes/NativelyAdmobBanner.js";
21
+ export { NativelyAdmobInterstitial } from "./classes/NativelyAdmobInterstitial.js";
22
+ export { NativelyNFCService } from "./classes/NativelyNFCService.js";
23
+ export { NativelyFirebaseNotifications } from './classes/NativelyFirebaseNotifications.js';
24
24
 
25
25
  // Hooks
26
- export { useNatively } from './hooks/useNatively';
26
+ export { useNatively } from './hooks/useNatively.js';
27
27
 
28
28
  // Utils
29
- export { generateID } from "./utils/generateID";
29
+ export { generateID } from "./utils/generateID.js";
30
30
 
31
31
  // Global stuff
32
32
  import "./types";
package/dist/inject.js CHANGED
@@ -1,26 +1,26 @@
1
- import globalContext from "./utils/globalThis";
2
- import { Natively } from "./classes/Natively";
3
- import { NativelyAdmobBanner } from "./classes/NativelyAdmobBanner";
4
- import { NativelyAdmobInterstitial } from "./classes/NativelyAdmobInterstitial";
5
- import { NativelyAppleSignInService } from "./classes/NativelyAppleSignInService";
6
- import { NativelyAudioRecorder } from "./classes/NativelyAudioRecorder";
7
- import { NativelyBiometrics } from "./classes/NativelyBiometrics";
8
- import { NativelyCamera } from "./classes/NativelyCamera";
9
- import { NativelyClipboard } from "./classes/NativelyClipboard";
10
- import { NativelyContacts } from "./classes/NativelyContacts";
11
- import { NativelyDatePicker } from "./classes/NativelyDatePicker";
12
- import { NativelyGeolocation } from "./classes/NativelyGeolocation";
13
- import { NativelyHealth } from "./classes/NativelyHealth";
14
- import { NativelyInfo } from "./classes/NativelyInfo";
15
- import { NativelyLocation } from "./classes/NativelyLocation";
16
- import { NativelyMediaPicker } from "./classes/NativelyMediaPicker";
17
- import { NativelyMessage } from "./classes/NativelyMessage";
18
- import { NativelyNFCService } from "./classes/NativelyNFCService";
19
- import { NativelyNotifications } from "./classes/NativelyNotifications";
20
- import { NativelyPurchases } from "./classes/NativelyPurchases";
21
- import { NativelyScanner } from "./classes/NativelyScanner";
22
- import { NativelyStorage } from "./classes/NativelyStorage";
23
- import { NativelyFirebaseNotifications } from "./classes/NativelyFirebaseNotifications";
1
+ import globalContext from "./utils/globalThis.js";
2
+ import { Natively } from "./classes/Natively.js";
3
+ import { NativelyAdmobBanner } from "./classes/NativelyAdmobBanner.js";
4
+ import { NativelyAdmobInterstitial } from "./classes/NativelyAdmobInterstitial.js";
5
+ import { NativelyAppleSignInService } from "./classes/NativelyAppleSignInService.js";
6
+ import { NativelyAudioRecorder } from "./classes/NativelyAudioRecorder.js";
7
+ import { NativelyBiometrics } from "./classes/NativelyBiometrics.js";
8
+ import { NativelyCamera } from "./classes/NativelyCamera.js";
9
+ import { NativelyClipboard } from "./classes/NativelyClipboard.js";
10
+ import { NativelyContacts } from "./classes/NativelyContacts.js";
11
+ import { NativelyDatePicker } from "./classes/NativelyDatePicker.js";
12
+ import { NativelyGeolocation } from "./classes/NativelyGeolocation.js";
13
+ import { NativelyHealth } from "./classes/NativelyHealth.js";
14
+ import { NativelyInfo } from "./classes/NativelyInfo.js";
15
+ import { NativelyLocation } from "./classes/NativelyLocation.js";
16
+ import { NativelyMediaPicker } from "./classes/NativelyMediaPicker.js";
17
+ import { NativelyMessage } from "./classes/NativelyMessage.js";
18
+ import { NativelyNFCService } from "./classes/NativelyNFCService.js";
19
+ import { NativelyNotifications } from "./classes/NativelyNotifications.js";
20
+ import { NativelyPurchases } from "./classes/NativelyPurchases.js";
21
+ import { NativelyScanner } from "./classes/NativelyScanner.js";
22
+ import { NativelyStorage } from "./classes/NativelyStorage.js";
23
+ import { NativelyFirebaseNotifications } from "./classes/NativelyFirebaseNotifications.js";
24
24
 
25
25
  // Assign natively to the global object
26
26
  if (globalContext) {
@@ -1 +1 @@
1
- (()=>{"use strict";var i={d:(e,t)=>{for(var l in t)i.o(t,l)&&!i.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}};i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(i){if("object"==typeof window)return window}}(),i.o=(i,e)=>Object.prototype.hasOwnProperty.call(i,e),i.r=i=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var e={};i.r(e),i.d(e,{Natively:()=>l,NativelyAdmobBanner:()=>A,NativelyAdmobInterstitial:()=>w,NativelyAppleSignInService:()=>s,NativelyAudioRecorder:()=>N,NativelyBiometrics:()=>c,NativelyCamera:()=>h,NativelyClipboard:()=>n,NativelyContacts:()=>m,NativelyDatePicker:()=>y,NativelyFirebaseNotifications:()=>I,NativelyGeolocation:()=>d,NativelyHealth:()=>p,NativelyInfo:()=>r,NativelyLocation:()=>g,NativelyMediaPicker:()=>f,NativelyMessage:()=>u,NativelyNFCService:()=>S,NativelyNotifications:()=>o,NativelyPurchases:()=>b,NativelyScanner:()=>_,NativelyStorage:()=>v,generateID:()=>a,useNatively:()=>k});const t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i.g?i.g:null;class l{constructor(){var i,e,l,a;this.isDebug=!1,this.min_app_version=0,this.app_version=0,this.injected=!1,this.observers=[],this.isIOSApp=(null===(e=null===(i=null==t?void 0:t.navigator)||void 0===i?void 0:i.userAgent)||void 0===e?void 0:e.includes("Natively/iOS"))||!1,this.isAndroidApp=(null===(a=null===(l=null==t?void 0:t.navigator)||void 0===l?void 0:l.userAgent)||void 0===a?void 0:a.includes("Natively/Android"))||!1}setDebug(i){t&&(t.natively.isDebug=i)}notify(i,e){t&&(t.natively.injected=!0,i&&(t.natively.min_app_version=i),e&&(t.natively.app_version=e));const l=null==t?void 0:t.natively.observers;for((null==t?void 0:t.natively.isDebug)&&console.log("[INFO] Notify observers: ",l.length);l.length>0;){const i=l.shift();null==i||i()}}addObserver(i){(null==t?void 0:t.natively.injected)?i():((null==t?void 0:t.natively.isDebug)&&console.log(`[DEBUG] addObserver: ${i}`),null==t||t.natively.observers.push(i))}trigger(i,e,l,a,s){const n=null==t?void 0:t.natively.isDebug;if(null==t?void 0:t.natively.injected)if(e>(null==t?void 0:t.natively.app_version))n&&alert(`[ERROR] Please rebuild the app to use this functionality. App Version: ${null==t?void 0:t.natively.app_version}, feature version: ${e}`);else{if(l){let e;e=i?a+"_response_"+i:a+"_response",t&&(t[e]=function(a,s){null==t||t.$agent.response(),s.message&&n?alert(`[ERROR] Error message: ${s.message}`):(n&&console.log(`[DEBUG] Callback method: ${e}, body: ${JSON.stringify(a)}, respId: ${i}`),l(a))}),s?s.response_id=i:s={response_id:i}}n&&console.log(`[DEBUG] Trigger method: ${a}, body: ${JSON.stringify(s)}`),null==t||t.$agent.trigger(a,s)}else null==t||t.natively.addObserver((()=>{null==t||t.natively.trigger(i,e,l,a,s)}))}openLogger(){null==t||t.$agent.natively_logger()}openConsole(){null==t||t.natively.trigger(void 0,22,void 0,"app_console")}closeApp(){null==t||t.natively.trigger(void 0,11,void 0,"app_close")}showProgress(i){null==t||t.natively.trigger(void 0,11,void 0,"app_show_progress",{toggle:i})}shareImage(i){null==t||t.natively.trigger(void 0,0,void 0,"share_image",{url:i})}shareText(i){null==t||t.natively.trigger(void 0,0,void 0,"share_text",{text:i})}shareTextAndImage(i,e){null==t||t.natively.trigger(void 0,0,void 0,"share_text_and_image",{url:e,text:i})}shareFile(i){null==t||t.natively.trigger(void 0,2,void 0,"share_file",{url:i})}openExternalURL(i,e){const l={url:void 0===i?"https://buildnatively.com":i,view:void 0!==e&&e?"external":"web"};null==t||t.natively.trigger(void 0,18,void 0,"open_link",l)}}const a=()=>Date.now().toString(36)+Math.random().toString(36).substring(2);class s{constructor(){this.id=a()}signin(i){null==t||t.natively.trigger(this.id,16,i,"apple_signin",{})}}class n{constructor(){this.id=a()}copy(i){null==t||t.natively.trigger(void 0,11,void 0,"clipboard_copy",{text:i})}paste(i){null==t||t.natively.trigger(this.id,11,i,"clipboard_paste")}}class r{constructor(){this.id=a()}browserInfo(){var i,e,l,a;return{isNativeApp:void 0!==(null==t?void 0:t.$agent),isIOSApp:(null===(e=null===(i=null==t?void 0:t.navigator)||void 0===i?void 0:i.userAgent)||void 0===e?void 0:e.includes("Natively/iOS"))||!1,isAndroidApp:(null===(a=null===(l=null==t?void 0:t.navigator)||void 0===l?void 0:l.userAgent)||void 0===a?void 0:a.includes("Natively/Android"))||!1}}getAppInfo(i){(null==t?void 0:t.natively)&&(null==t||t.natively.trigger(this.id,0,i,"app_info"))}connectivity(i){(null==t?void 0:t.natively)&&(null==t||t.natively.trigger(void 0,0,i,"connectivity"))}app_state(i){(null==t?void 0:t.natively)&&(null==t||t.natively.trigger(void 0,19,i,"app_state"))}}class o{constructor(){this.id=a()}getOneSignalId(i){null==t||t.natively.trigger(this.id,0,i,"onesignal_playerid")}requestPermission(i,e){null==t||t.natively.trigger(this.id,0,e,"push_register",{fallbackToSettings:i})}getPermissionStatus(i){null==t||t.natively.trigger(this.id,0,i,"push_permission")}}class d{constructor(){this.id=a()}getUserGeolocation(i,e){null==t||t.natively.trigger(this.id,0,e,"geolocation",{distance:i})}requestPermission(i){null==t||t.natively.trigger(this.id,0,i,"geo_register")}getPermissionStatus(i){null==t||t.natively.trigger(this.id,0,i,"geo_permission")}}class g{constructor(){this.id=a()}current(i,e,l,a){null==t||t.natively.trigger(this.id,12,a,"location_current",{minAccuracy:i,accuracyType:e,priority:l})}permission(i){null==t||t.natively.trigger(this.id,6,i,"location_permission")}start(i,e,l,a,s){null==t||t.natively.trigger(this.id,12,s,"location_start",{minAccuracy:e,accuracyType:l,priority:a,interval:i})}stop(){null==t||t.natively.trigger(this.id,3,void 0,"location_stop",{})}startBackground(i,e,l,a,s,n){const r={identifier:null!=s?s:"empty",interval:null!=i?i:6e4,minAccuracy:null!=e?e:50,accuracyType:null!=l?l:"Best",priority:null!=a?a:"BALANCED"};null==t||t.natively.trigger(this.id,12,n,"location_start_bg",r)}statusBackground(i){null==t||t.natively.trigger(this.id,20,i,"location_status_bg",{})}stopBackground(i){null==t||t.natively.trigger(this.id,4,i,"location_stop_bg",{})}}class u{constructor(){this.id=a()}sendSMS(i,e,l){const a={body:null!=i?i:"",recipient:null!=e?e:""};null==t||t.natively.trigger(this.id,0,l,"send_sms",a)}sendEmail(i,e,l,a){const s={subject:null!=i?i:"",body:null!=e?e:"",recipient:null!=l?l:""};null==t||t.natively.trigger(this.id,0,a,"send_email",s)}}class v{constructor(){this.id=a()}setStorageValue(i,e){null==t||t.natively.trigger(this.id,0,void 0,"set_storage_value",{key:i,value:e})}getStorageValue(i,e){null==t||t.natively.trigger(this.id,0,e,"get_storage_value",{key:i})}removeStorageValue(i){null==t||t.natively.trigger(this.id,0,void 0,"remove_storage_value",{key:i})}resetStorage(){null==t||t.natively.trigger(this.id,0,void 0,"reset_storage")}}class c{constructor(i){this.id=a(),this.allowPass=i}checkBiometricsSupport(i){null==t||t.natively.trigger(this.id,0,i,"biometrics_support",{allowPass:this.allowPass})}checkCredentials(i){null==t||t.natively.trigger(this.id,0,i,"biometrics_has_credentials")}verifyUserIdentify(i){null==t||t.natively.trigger(this.id,0,i,"biometrics_verify",{allowPass:this.allowPass})}getUserCredentials(i){null==t||t.natively.trigger(this.id,0,i,"biometrics_auth",{allowPass:this.allowPass})}removeUserCredentials(i){null==t||t.natively.trigger(this.id,0,i,"biometrics_remove_credentials")}saveUserCredentials(i,e,l){null==t||t.natively.trigger(this.id,0,l,"biometrics_auth",{allowPass:this.allowPass,login:i,password:e})}}class y{constructor(){this.id=a()}showDatePicker(i,e,l,a,s){const n={type:null!=l?l:"DATE",style:null!=a?a:"LIGHT",title:null!=i?i:"",description:null!=e?e:""};null==t||t.natively.trigger(this.id,0,s,"datepicker",n)}}class h{constructor(){this.id=a()}showCamera(i,e,l,a){const s={type:null!=i?i:"photo",quality:null!=e?e:"high",camera:null!=l?l:"BACK"};null==t||t.natively.trigger(this.id,2,a,"open_camera",s)}}class p{constructor(){this.id=a()}available(i){null==t||t.natively.trigger(this.id,10,i,"health_available",{})}requestAuthorization(i,e,l){null==t||t.natively.trigger(this.id,10,l,"health_register",{write_data_types:i,read_data_types:e})}permissionStatus(i,e){null==t||t.natively.trigger(this.id,10,e,"health_permission",{data_type:i})}getAllCharacteristics(i){null==t||t.natively.trigger(this.id,10,i,"health_get_all_characteristics",{})}getStatisticQuantity(i,e,l,a,s){const n={data_type:i,interval:e};l&&(n.start_date=l.getTime()),a&&(n.end_date=a.getTime()),null==t||t.natively.trigger(this.id,10,s,"health_get_statistic_quantity",n)}}class _{constructor(){this.id=a()}showScanner(i){null==t||t.natively.trigger(this.id,2,i,"open_scanner",{})}}class b{constructor(){this.id=a()}login(i,e,l){const a=null!=e?e:"";null==t||t.natively.trigger(this.id,3,l,"purchases_login",{login:i,email:a})}logout(i){null==t||t.natively.trigger(this.id,3,i,"purchases_logout",{})}customerId(i){null==t||t.natively.trigger(this.id,3,i,"purchases_customerid",{})}restore(i){null==t||t.natively.trigger(this.id,10,i,"purchases_restore",{})}purchasePackage(i,e){null==t||t.natively.trigger(this.id,3,e,"purchases_package",{packageId:i})}packagePrice(i,e){null==t||t.natively.trigger(this.id,8,e,"purchases_price",{packageId:i})}}class m{constructor(){this.id=a()}getAllContacts(i){null==t||t.natively.trigger(this.id,3,i,"contacts_all",{})}createContact(i,e,l,a,s){const n={firstName:i,lastName:null!=e?e:"",email:null!=l?l:"",phone:null!=a?a:""};null==t||t.natively.trigger(this.id,3,s,"contacts_save",n)}}class f{constructor(){this.id=a()}showMediaPicker(i){null==t||t.natively.trigger(this.id,8,i,"mediapicker",{})}}class N{constructor(){this.id=a()}showRecorder(i,e){const l={max_duration:null!=i?i:0};null==t||t.natively.trigger(this.id,13,e,"record_start",l)}}class A{constructor(i,e,l=!1,s,n=!1,r){var o,d,g,u,v,c;this.id=a();const y={};(null==t?void 0:t.natively.isAndroidApp)?y.unitId=null!==(o=i.androidUnitId)&&void 0!==o?o:"ca-app-pub-3940256099942544/6300978111":(null==t?void 0:t.natively.isIOSApp)&&(y.unitId=null!==(d=i.iOSUnitId)&&void 0!==d?d:"ca-app-pub-3940256099942544/2934735716"),y.position=null!==(g=i.position)&&void 0!==g?g:"BOTTOM",y.sizeType=null!==(u=i.sizeType)&&void 0!==u?u:"AUTO",y.width=null!==(v=i.custom_width)&&void 0!==v?v:320,y.height=null!==(c=i.custom_height)&&void 0!==c?c:50,null==t||t.natively.trigger(this.id,14,(i=>{null==e||e(i),l&&(null==t||t.natively.trigger(this.id,14,(i=>{null==s||s(i),n&&(null==t||t.natively.trigger(this.id,14,r,"bannerad_show",{}))}),"bannerad_load",{}))}),"bannerad_setup",y)}loadAd(i){null==t||t.natively.trigger(this.id,14,i,"bannerad_load",{})}showBanner(i){null==t||t.natively.trigger(this.id,14,i,"bannerad_show",{})}hideBanner(i){null==t||t.natively.trigger(this.id,14,i,"bannerad_hide",{})}bannerIsReady(i){null==t||t.natively.trigger(this.id,14,i,"bannerad_ready",{})}bannerIsVisible(i){null==t||t.natively.trigger(this.id,14,i,"bannerad_visible",{})}}class w{constructor(i="ca-app-pub-3940256099942544/4411468910",e="ca-app-pub-3940256099942544/1033173712",l,s=!1,n){this.id=a(),(null==t?void 0:t.natively.isAndroidApp)?this.unitId=e:(null==t?void 0:t.natively.isIOSApp)&&(this.unitId=i),this.auto_ad_reload=s,this.auto_ad_reload_callback=n,this.loadAd(l)}loadAd(i){var e;const l={unitId:null!==(e=this.unitId)&&void 0!==e?e:"ca-app-pub-3940256099942544/4411468910"};null==t||t.natively.trigger(this.id,14,i,"interstitialad_setup",l)}showInterstitialAd(i){null==t||t.natively.trigger(this.id,14,(e=>{i(e),"DID_DISMISS_AD"===e.event&&this.auto_ad_reload&&setTimeout((()=>{this.loadAd(this.auto_ad_reload_callback)}),500)}),"interstitialad_show",{})}interstitialIsReady(i){null==t||t.natively.trigger(this.id,14,i,"interstitialad_ready",{})}}class S{constructor(i,e,t,l){this.id=a(),this.readAlertMessage=i,this.writeAlertMessage=e,this.readDetectedMessage=t,this.writeDetectedMessage=l}read(i){var e,l;const a={alertMessage:null!==(e=this.readAlertMessage)&&void 0!==e?e:"please set readAlertMessage",detectedMessage:null!==(l=this.readDetectedMessage)&&void 0!==l?l:"readDetectedMessage"};null==t||t.natively.trigger(this.id,15,i,"nfc_read",a)}write(i,e,l){var a,s;const n={alertMessage:null!==(a=this.writeAlertMessage)&&void 0!==a?a:"please set writeAlertMessage",detectedMessage:null!==(s=this.writeDetectedMessage)&&void 0!==s?s:"please set writeDetectedMessage",recordData:null!=e?e:"please set recordData",recordId:null!=i?i:"please set recordId"};null==t||t.natively.trigger(this.id,15,l,"nfc_write",n)}available(i){null==t||t.natively.trigger(this.id,15,i,"nfc_available",{})}}class I{constructor(){this.id=a()}firebase_get_token(i){null==t||t.natively.trigger(this.id,31,i,"firebase_get_token")}firebase_get_apns_token(i){null==t||t.natively.trigger(this.id,31,i,"firebase_get_apns_token")}firebase_request_permission(i){null==t||t.natively.trigger(this.id,31,i,"firebase_request_permission")}firebase_has_permission(i){null==t||t.natively.trigger(this.id,31,i,"firebase_has_permission")}firebase_subscribe_to_topic(i,e){null==t||t.natively.trigger(this.id,31,e,"firebase_subscribe_to_topic",{topic:i})}firebase_unsubscribe_from_topic(i,e){null==t||t.natively.trigger(this.id,31,e,"firebase_unsubscribe_from_topic",{topic:i})}}const k=()=>null==t?void 0:t.natively;t&&(t.natively=new l,t.NativelyAdmobBanner=A,t.NativelyAdmobInterstitial=w,t.NativelyAppleSignInService=s,t.NativelyAudioRecorder=N,t.NativelyBiometrics=c,t.NativelyCamera=h,t.NativelyClipboard=n,t.NativelyContacts=m,t.NativelyDatePicker=y,t.NativelyGeolocation=d,t.NativelyHealth=p,t.NativelyInfo=r,t.NativelyLocation=g,t.NativelyMediaPicker=f,t.NativelyMessage=u,t.NativelyNFCService=S,t.NativelyNotifications=o,t.NativelyPurchases=b,t.NativelyScanner=_,t.NativelyStorage=v,t.NativelyFirebaseNotifications=I),null==t||t.natively.addObserver((()=>null==t?void 0:t.natively.trigger(void 0,0,(i=>{t&&(t.natively.min_app_version=i.minSDKVersion,t.natively.app_version=i.sdkVersion)}),"app_info",{})))})();
1
+ (()=>{"use strict";var e={d:(i,t)=>{for(var l in t)e.o(t,l)&&!e.o(i,l)&&Object.defineProperty(i,l,{enumerable:!0,get:t[l]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};e.r(i),e.d(i,{Natively:()=>l,NativelyAdmobBanner:()=>A,NativelyAdmobInterstitial:()=>w,NativelyAppleSignInService:()=>a,NativelyAudioRecorder:()=>N,NativelyBiometrics:()=>c,NativelyCamera:()=>y,NativelyClipboard:()=>r,NativelyContacts:()=>m,NativelyDatePicker:()=>p,NativelyFirebaseNotifications:()=>I,NativelyGeolocation:()=>d,NativelyHealth:()=>h,NativelyInfo:()=>s,NativelyLocation:()=>g,NativelyMediaPicker:()=>f,NativelyMessage:()=>v,NativelyNFCService:()=>S,NativelyNotifications:()=>o,NativelyPurchases:()=>b,NativelyScanner:()=>_,NativelyStorage:()=>u,generateID:()=>n,useNatively:()=>P});const t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e.g?e.g:null;class l{constructor(){var e,i,l,n;this.isDebug=!1,this.min_app_version=0,this.app_version=0,this.injected=!1,this.observers=[],this.isIOSApp=(null===(i=null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.userAgent)||void 0===i?void 0:i.includes("Natively/iOS"))||!1,this.isAndroidApp=(null===(n=null===(l=null==t?void 0:t.navigator)||void 0===l?void 0:l.userAgent)||void 0===n?void 0:n.includes("Natively/Android"))||!1}setDebug(e){t&&(t.natively.isDebug=e)}notify(e,i){t&&(t.natively.injected=!0,e&&(t.natively.min_app_version=e),i&&(t.natively.app_version=i));const l=null==t?void 0:t.natively.observers;for((null==t?void 0:t.natively.isDebug)&&console.log("[INFO] Notify observers: ",l.length);l.length>0;){const e=l.shift();null==e||e()}}addObserver(e){(null==t?void 0:t.natively.injected)?e():((null==t?void 0:t.natively.isDebug)&&console.log(`[DEBUG] addObserver: ${e}`),null==t||t.natively.observers.push(e))}trigger(e,i,l,n,a){const r=null==t?void 0:t.natively.isDebug;if(null==t?void 0:t.natively.injected)if(i>(null==t?void 0:t.natively.app_version))r&&alert(`[ERROR] Please rebuild the app to use this functionality. App Version: ${null==t?void 0:t.natively.app_version}, feature version: ${i}`);else{if(l){let i;i=e?n+"_response_"+e:n+"_response",t&&(t[i]=function(n,a){null==t||t.$agent.response(),a.message&&r?alert(`[ERROR] Error message: ${a.message}`):(r&&console.log(`[DEBUG] Callback method: ${i}, body: ${JSON.stringify(n)}, respId: ${e}`),l(n))}),a?a.response_id=e:a={response_id:e}}r&&console.log(`[DEBUG] Trigger method: ${n}, body: ${JSON.stringify(a)}`),null==t||t.$agent.trigger(n,a)}else null==t||t.natively.addObserver((()=>{null==t||t.natively.trigger(e,i,l,n,a)}))}openLogger(){null==t||t.$agent.natively_logger()}openConsole(){null==t||t.natively.trigger(void 0,22,void 0,"app_console")}closeApp(){null==t||t.natively.trigger(void 0,11,void 0,"app_close")}showProgress(e){null==t||t.natively.trigger(void 0,11,void 0,"app_show_progress",{toggle:e})}shareImage(e){null==t||t.natively.trigger(void 0,0,void 0,"share_image",{url:e})}shareText(e){null==t||t.natively.trigger(void 0,0,void 0,"share_text",{text:e})}shareTextAndImage(e,i){null==t||t.natively.trigger(void 0,0,void 0,"share_text_and_image",{url:i,text:e})}shareFile(e){null==t||t.natively.trigger(void 0,2,void 0,"share_file",{url:e})}openExternalURL(e,i){const l={url:void 0===e?"https://buildnatively.com":e,view:void 0!==i&&i?"external":"web"};null==t||t.natively.trigger(void 0,18,void 0,"open_link",l)}openExternalApp(e){null==t||t.natively.trigger(void 0,22,void 0,"open_app",{url:e})}showAppToast(e,i){null==t||t.natively.trigger(void 0,0,void 0,"show_toast",{text:i||"",type:e||"DEFAULT"})}showAppBanner(e,i,l){null==t||t.natively.trigger(void 0,0,void 0,"show_banner",{type:e||"INFO",title:i||"",description:l||""})}requestAppReview(){null==t||t.natively.trigger(void 0,0,void 0,"request_review")}setAppBackgroundColor(e){null==t||t.natively.trigger(void 0,1,void 0,"app_background",{color:e})}setAppProgressColor(e){null==t||t.natively.trigger(void 0,1,void 0,"app_progress",{color:e})}setAppSwipeNavigation(e){null==t||t.natively.trigger(void 0,22,void 0,"app_navigation",{toggle:e})}setAppPullToRefresh(e){null==t||t.natively.trigger(void 0,1,void 0,"app_pull",{toggle:e})}setAppOrientation(e){null==t||t.natively.trigger(void 0,3,void 0,"app_orientation",{orientation:e})}setAppStatusBarStyle(e){null==t||t.natively.trigger(void 0,22,void 0,"status_bar_style",{style:e})}hideLoadingScreen(){null==t||t.natively.trigger(void 0,17,void 0,"loading_screen",{show_loader:!1,auto_hide:!0})}showLoadingScreen(e){null==t||t.natively.trigger(void 0,17,void 0,"loading_screen",{show_loader:!0,auto_hide:e||!1})}openAppSettings(){null==t||t.natively.trigger(void 0,0,void 0,"open_appsettings")}hapticPattern(e,i){null==t||t.natively.trigger(void 0,22,void 0,"haptic_pattern",{pattern:e,delay:i})}hapticImpact(e){null==t||t.natively.trigger(void 0,22,void 0,"haptic_impact",{type:e})}hapticNotification(e){null==t||t.natively.trigger(void 0,22,void 0,"haptic_notification",{type:e})}sendPushNotification(e,i,t,l){return n=this,a=void 0,s=function*(){const n=t.filter((e=>e.length>0)),a=[...new Set(n)],r={app_id:l?"be83022a-1d08-45d0-a07a-0c3655666e17":e,include_player_ids:a};i.template_id?r.template_id=i.template_id:(r.headings={en:i.title||"Empty Title"},r.contents={en:i.message||"Empty Message"},i.subtitle&&(r.subtitle={en:i.subtitle}),i.redirect_url&&(r.url=i.redirect_url));const s={method:"POST",headers:{"Content-type":"application/json"},body:JSON.stringify(r)};return yield fetch("https://onesignal.com/api/v1/notifications",s)},new((r=void 0)||(r=Promise))((function(e,i){function t(e){try{o(s.next(e))}catch(e){i(e)}}function l(e){try{o(s.throw(e))}catch(e){i(e)}}function o(i){var n;i.done?e(i.value):(n=i.value,n instanceof r?n:new r((function(e){e(n)}))).then(t,l)}o((s=s.apply(n,a||[])).next())}));var n,a,r,s}}const n=()=>Date.now().toString(36)+Math.random().toString(36).substring(2);class a{constructor(){this.id=n()}signin(e){null==t||t.natively.trigger(this.id,16,e,"apple_signin",{})}}class r{constructor(){this.id=n()}copy(e){null==t||t.natively.trigger(void 0,11,void 0,"clipboard_copy",{text:e})}paste(e){null==t||t.natively.trigger(this.id,11,e,"clipboard_paste")}}class s{constructor(){this.id=n()}browserInfo(){var e,i,l,n;return{isNativeApp:void 0!==(null==t?void 0:t.$agent),isIOSApp:(null===(i=null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.userAgent)||void 0===i?void 0:i.includes("Natively/iOS"))||!1,isAndroidApp:(null===(n=null===(l=null==t?void 0:t.navigator)||void 0===l?void 0:l.userAgent)||void 0===n?void 0:n.includes("Natively/Android"))||!1}}getAppInfo(e){(null==t?void 0:t.natively)&&(null==t||t.natively.trigger(this.id,0,e,"app_info"))}connectivity(e){(null==t?void 0:t.natively)&&(null==t||t.natively.trigger(void 0,0,e,"connectivity"))}app_state(e){(null==t?void 0:t.natively)&&(null==t||t.natively.trigger(void 0,19,e,"app_state"))}}class o{constructor(){this.id=n()}getOneSignalId(e){null==t||t.natively.trigger(this.id,0,e,"onesignal_playerid")}requestPermission(e,i){null==t||t.natively.trigger(this.id,0,i,"push_register",{fallbackToSettings:e})}getPermissionStatus(e){null==t||t.natively.trigger(this.id,0,e,"push_permission")}}class d{constructor(){this.id=n()}getUserGeolocation(e,i){null==t||t.natively.trigger(this.id,0,i,"geolocation",{distance:e})}requestPermission(e){null==t||t.natively.trigger(this.id,0,e,"geo_register")}getPermissionStatus(e){null==t||t.natively.trigger(this.id,0,e,"geo_permission")}}class g{constructor(){this.id=n()}current(e,i,l,n){null==t||t.natively.trigger(this.id,12,n,"location_current",{minAccuracy:e,accuracyType:i,priority:l})}permission(e){null==t||t.natively.trigger(this.id,6,e,"location_permission")}start(e,i,l,n,a){null==t||t.natively.trigger(this.id,12,a,"location_start",{minAccuracy:i,accuracyType:l,priority:n,interval:e})}stop(){null==t||t.natively.trigger(this.id,3,void 0,"location_stop",{})}startBackground(e,i,l,n,a,r){const s={identifier:null!=a?a:"empty",interval:null!=e?e:6e4,minAccuracy:null!=i?i:50,accuracyType:null!=l?l:"Best",priority:null!=n?n:"BALANCED"};null==t||t.natively.trigger(this.id,12,r,"location_start_bg",s)}statusBackground(e){null==t||t.natively.trigger(this.id,20,e,"location_status_bg",{})}stopBackground(e){null==t||t.natively.trigger(this.id,4,e,"location_stop_bg",{})}}class v{constructor(){this.id=n()}sendSMS(e,i,l){const n={body:null!=e?e:"",recipient:null!=i?i:""};null==t||t.natively.trigger(this.id,0,l,"send_sms",n)}sendEmail(e,i,l,n){const a={subject:null!=e?e:"",body:null!=i?i:"",recipient:null!=l?l:""};null==t||t.natively.trigger(this.id,0,n,"send_email",a)}}class u{constructor(){this.id=n()}setStorageValue(e,i){null==t||t.natively.trigger(this.id,0,void 0,"set_storage_value",{key:e,value:i})}getStorageValue(e,i){null==t||t.natively.trigger(this.id,0,i,"get_storage_value",{key:e})}removeStorageValue(e){null==t||t.natively.trigger(this.id,0,void 0,"remove_storage_value",{key:e})}resetStorage(){null==t||t.natively.trigger(this.id,0,void 0,"reset_storage")}}class c{constructor(e){this.id=n(),this.allowPass=e}checkBiometricsSupport(e){null==t||t.natively.trigger(this.id,0,e,"biometrics_support",{allowPass:this.allowPass})}checkCredentials(e){null==t||t.natively.trigger(this.id,0,e,"biometrics_has_credentials")}verifyUserIdentify(e){null==t||t.natively.trigger(this.id,0,e,"biometrics_verify",{allowPass:this.allowPass})}getUserCredentials(e){null==t||t.natively.trigger(this.id,0,e,"biometrics_auth",{allowPass:this.allowPass})}removeUserCredentials(e){null==t||t.natively.trigger(this.id,0,e,"biometrics_remove_credentials")}saveUserCredentials(e,i,l){null==t||t.natively.trigger(this.id,0,l,"biometrics_auth",{allowPass:this.allowPass,login:e,password:i})}}class p{constructor(){this.id=n()}showDatePicker(e,i,l,n,a){const r={type:null!=l?l:"DATE",style:null!=n?n:"LIGHT",title:null!=e?e:"",description:null!=i?i:""};null==t||t.natively.trigger(this.id,0,a,"datepicker",r)}}class y{constructor(){this.id=n()}showCamera(e,i,l,n){const a={type:null!=e?e:"photo",quality:null!=i?i:"high",camera:null!=l?l:"BACK"};null==t||t.natively.trigger(this.id,2,n,"open_camera",a)}}class h{constructor(){this.id=n()}available(e){null==t||t.natively.trigger(this.id,10,e,"health_available",{})}requestAuthorization(e,i,l){null==t||t.natively.trigger(this.id,10,l,"health_register",{write_data_types:e,read_data_types:i})}permissionStatus(e,i){null==t||t.natively.trigger(this.id,10,i,"health_permission",{data_type:e})}getAllCharacteristics(e){null==t||t.natively.trigger(this.id,10,e,"health_get_all_characteristics",{})}getStatisticQuantity(e,i,l,n,a){const r={data_type:e,interval:i};l&&(r.start_date=l.getTime()),n&&(r.end_date=n.getTime()),null==t||t.natively.trigger(this.id,10,a,"health_get_statistic_quantity",r)}}class _{constructor(){this.id=n()}showScanner(e){null==t||t.natively.trigger(this.id,2,e,"open_scanner",{})}}class b{constructor(){this.id=n()}login(e,i,l){const n=null!=i?i:"";null==t||t.natively.trigger(this.id,3,l,"purchases_login",{login:e,email:n})}logout(e){null==t||t.natively.trigger(this.id,3,e,"purchases_logout",{})}customerId(e){null==t||t.natively.trigger(this.id,3,e,"purchases_customerid",{})}restore(e){null==t||t.natively.trigger(this.id,10,e,"purchases_restore",{})}purchasePackage(e,i){null==t||t.natively.trigger(this.id,3,i,"purchases_package",{packageId:e})}packagePrice(e,i){null==t||t.natively.trigger(this.id,8,i,"purchases_price",{packageId:e})}}class m{constructor(){this.id=n()}getAllContacts(e){null==t||t.natively.trigger(this.id,3,e,"contacts_all",{})}createContact(e,i,l,n,a){const r={firstName:e,lastName:null!=i?i:"",email:null!=l?l:"",phone:null!=n?n:""};null==t||t.natively.trigger(this.id,3,a,"contacts_save",r)}}class f{constructor(){this.id=n()}showMediaPicker(e){null==t||t.natively.trigger(this.id,8,e,"mediapicker",{})}}class N{constructor(){this.id=n()}showRecorder(e,i){const l={max_duration:null!=e?e:0};null==t||t.natively.trigger(this.id,13,i,"record_start",l)}}class A{constructor(e,i,l=!1,a,r=!1,s){var o,d,g,v,u,c;this.id=n();const p={};(null==t?void 0:t.natively.isAndroidApp)?p.unitId=null!==(o=e.androidUnitId)&&void 0!==o?o:"ca-app-pub-3940256099942544/6300978111":(null==t?void 0:t.natively.isIOSApp)&&(p.unitId=null!==(d=e.iOSUnitId)&&void 0!==d?d:"ca-app-pub-3940256099942544/2934735716"),p.position=null!==(g=e.position)&&void 0!==g?g:"BOTTOM",p.sizeType=null!==(v=e.sizeType)&&void 0!==v?v:"AUTO",p.width=null!==(u=e.custom_width)&&void 0!==u?u:320,p.height=null!==(c=e.custom_height)&&void 0!==c?c:50,null==t||t.natively.trigger(this.id,14,(e=>{null==i||i(e),l&&(null==t||t.natively.trigger(this.id,14,(e=>{null==a||a(e),r&&(null==t||t.natively.trigger(this.id,14,s,"bannerad_show",{}))}),"bannerad_load",{}))}),"bannerad_setup",p)}loadAd(e){null==t||t.natively.trigger(this.id,14,e,"bannerad_load",{})}showBanner(e){null==t||t.natively.trigger(this.id,14,e,"bannerad_show",{})}hideBanner(e){null==t||t.natively.trigger(this.id,14,e,"bannerad_hide",{})}bannerIsReady(e){null==t||t.natively.trigger(this.id,14,e,"bannerad_ready",{})}bannerIsVisible(e){null==t||t.natively.trigger(this.id,14,e,"bannerad_visible",{})}}class w{constructor(e="ca-app-pub-3940256099942544/4411468910",i="ca-app-pub-3940256099942544/1033173712",l,a=!1,r){this.id=n(),(null==t?void 0:t.natively.isAndroidApp)?this.unitId=i:(null==t?void 0:t.natively.isIOSApp)&&(this.unitId=e),this.auto_ad_reload=a,this.auto_ad_reload_callback=r,this.loadAd(l)}loadAd(e){var i;const l={unitId:null!==(i=this.unitId)&&void 0!==i?i:"ca-app-pub-3940256099942544/4411468910"};null==t||t.natively.trigger(this.id,14,e,"interstitialad_setup",l)}showInterstitialAd(e){null==t||t.natively.trigger(this.id,14,(i=>{e(i),"DID_DISMISS_AD"===i.event&&this.auto_ad_reload&&setTimeout((()=>{this.loadAd(this.auto_ad_reload_callback)}),500)}),"interstitialad_show",{})}interstitialIsReady(e){null==t||t.natively.trigger(this.id,14,e,"interstitialad_ready",{})}}class S{constructor(e,i,t,l){this.id=n(),this.readAlertMessage=e,this.writeAlertMessage=i,this.readDetectedMessage=t,this.writeDetectedMessage=l}read(e){var i,l;const n={alertMessage:null!==(i=this.readAlertMessage)&&void 0!==i?i:"please set readAlertMessage",detectedMessage:null!==(l=this.readDetectedMessage)&&void 0!==l?l:"readDetectedMessage"};null==t||t.natively.trigger(this.id,15,e,"nfc_read",n)}write(e,i,l){var n,a;const r={alertMessage:null!==(n=this.writeAlertMessage)&&void 0!==n?n:"please set writeAlertMessage",detectedMessage:null!==(a=this.writeDetectedMessage)&&void 0!==a?a:"please set writeDetectedMessage",recordData:null!=i?i:"please set recordData",recordId:null!=e?e:"please set recordId"};null==t||t.natively.trigger(this.id,15,l,"nfc_write",r)}available(e){null==t||t.natively.trigger(this.id,15,e,"nfc_available",{})}}class I{constructor(){this.id=n()}firebase_get_token(e){null==t||t.natively.trigger(this.id,31,e,"firebase_get_token")}firebase_get_apns_token(e){null==t||t.natively.trigger(this.id,31,e,"firebase_get_apns_token")}firebase_request_permission(e){null==t||t.natively.trigger(this.id,31,e,"firebase_request_permission")}firebase_has_permission(e){null==t||t.natively.trigger(this.id,31,e,"firebase_has_permission")}firebase_subscribe_to_topic(e,i){null==t||t.natively.trigger(this.id,31,i,"firebase_subscribe_to_topic",{topic:e})}firebase_unsubscribe_from_topic(e,i){null==t||t.natively.trigger(this.id,31,i,"firebase_unsubscribe_from_topic",{topic:e})}}const P=()=>null==t?void 0:t.natively;t&&(t.natively=new l,t.NativelyAdmobBanner=A,t.NativelyAdmobInterstitial=w,t.NativelyAppleSignInService=a,t.NativelyAudioRecorder=N,t.NativelyBiometrics=c,t.NativelyCamera=y,t.NativelyClipboard=r,t.NativelyContacts=m,t.NativelyDatePicker=p,t.NativelyGeolocation=d,t.NativelyHealth=h,t.NativelyInfo=s,t.NativelyLocation=g,t.NativelyMediaPicker=f,t.NativelyMessage=v,t.NativelyNFCService=S,t.NativelyNotifications=o,t.NativelyPurchases=b,t.NativelyScanner=_,t.NativelyStorage=u,t.NativelyFirebaseNotifications=I),null==t||t.natively.addObserver((()=>null==t?void 0:t.natively.trigger(void 0,0,(e=>{t&&(t.natively.min_app_version=e.minSDKVersion,t.natively.app_version=e.sdkVersion)}),"app_info",{})))})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natively",
3
- "version": "2.15.2",
3
+ "version": "2.15.4",
4
4
  "description": "Natively SDK for building native-like web applications",
5
5
  "type": "module",
6
6
  "exports": {
@@ -15,10 +15,11 @@
15
15
  ],
16
16
  "package-name": "buildnatively/js-sdk#typescript_module",
17
17
  "scripts": {
18
- "build": "npm run build:types && npm run build:webpack && npm run build:module",
18
+ "build": "npm run build:webpack && npm run build:types && npm run build:module && npm run build:post",
19
19
  "build:types": "tsc --emitDeclarationOnly",
20
20
  "build:webpack": "webpack build",
21
- "build:module": "babel src --extensions \".ts\" --config-file ./babel.config.module.cjs --out-dir ./dist/"
21
+ "build:module": "babel src --extensions \".ts\" --config-file ./babel.config.module.cjs --out-dir ./dist/",
22
+ "build:post": "node postbuild.cjs"
22
23
  },
23
24
  "repository": {
24
25
  "type": "git",