@sendoracloud/sdk-react-native 0.20.0 → 0.20.1
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/dist/index.cjs +9 -9
- package/dist/index.js +4 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -195,6 +195,7 @@ async function request(opts, method, path, body, extraHeaders) {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
// src/auth.ts
|
|
198
|
+
var import_react_native = require("react-native");
|
|
198
199
|
var TOKEN_KEY = "auth_access_token";
|
|
199
200
|
var TOKEN_EXPIRES_KEY = "auth_access_expires";
|
|
200
201
|
var REFRESH_KEY = "auth_refresh_token";
|
|
@@ -850,8 +851,7 @@ var Auth = class {
|
|
|
850
851
|
void tick();
|
|
851
852
|
}, TICK_MS);
|
|
852
853
|
try {
|
|
853
|
-
const
|
|
854
|
-
const subscription = RN.AppState?.addEventListener?.("change", (state) => {
|
|
854
|
+
const subscription = import_react_native.AppState?.addEventListener?.("change", (state) => {
|
|
855
855
|
if (state === "active") void tick();
|
|
856
856
|
});
|
|
857
857
|
if (subscription) {
|
|
@@ -1004,7 +1004,7 @@ function decodeJwtPayload(token) {
|
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
1006
|
// src/links.ts
|
|
1007
|
-
var
|
|
1007
|
+
var import_react_native2 = require("react-native");
|
|
1008
1008
|
var LinkError = class extends Error {
|
|
1009
1009
|
constructor(code, message, statusCode = 0, details) {
|
|
1010
1010
|
super(message);
|
|
@@ -1083,10 +1083,10 @@ function dynRequire(id) {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
function loadRn() {
|
|
1085
1085
|
return {
|
|
1086
|
-
Platform:
|
|
1087
|
-
Dimensions:
|
|
1088
|
-
NativeModules:
|
|
1089
|
-
Linking:
|
|
1086
|
+
Platform: import_react_native2.Platform,
|
|
1087
|
+
Dimensions: import_react_native2.Dimensions,
|
|
1088
|
+
NativeModules: import_react_native2.NativeModules,
|
|
1089
|
+
Linking: import_react_native2.Linking
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
1092
|
function readTimezone() {
|
|
@@ -1568,7 +1568,7 @@ var Links = class {
|
|
|
1568
1568
|
};
|
|
1569
1569
|
|
|
1570
1570
|
// src/auto-track.ts
|
|
1571
|
-
var
|
|
1571
|
+
var import_react_native3 = require("react-native");
|
|
1572
1572
|
var DEFAULT_IDLE_MS = 30 * 60 * 1e3;
|
|
1573
1573
|
function resolveFlags(cfg) {
|
|
1574
1574
|
if (cfg === false) {
|
|
@@ -1612,7 +1612,7 @@ function installAutoTrack(args) {
|
|
|
1612
1612
|
args.fire("app.opened", { sessionId });
|
|
1613
1613
|
}
|
|
1614
1614
|
if (flags.appBackground) {
|
|
1615
|
-
const AppState =
|
|
1615
|
+
const AppState = import_react_native3.AppState;
|
|
1616
1616
|
if (AppState && typeof AppState.addEventListener === "function") {
|
|
1617
1617
|
const handler = (state) => {
|
|
1618
1618
|
ensureSession(true);
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/index.ts
|
|
9
2
|
import "react-native-get-random-values";
|
|
10
3
|
|
|
@@ -159,6 +152,7 @@ async function request(opts, method, path, body, extraHeaders) {
|
|
|
159
152
|
}
|
|
160
153
|
|
|
161
154
|
// src/auth.ts
|
|
155
|
+
import { AppState as RnAppState } from "react-native";
|
|
162
156
|
var TOKEN_KEY = "auth_access_token";
|
|
163
157
|
var TOKEN_EXPIRES_KEY = "auth_access_expires";
|
|
164
158
|
var REFRESH_KEY = "auth_refresh_token";
|
|
@@ -814,8 +808,7 @@ var Auth = class {
|
|
|
814
808
|
void tick();
|
|
815
809
|
}, TICK_MS);
|
|
816
810
|
try {
|
|
817
|
-
const
|
|
818
|
-
const subscription = RN.AppState?.addEventListener?.("change", (state) => {
|
|
811
|
+
const subscription = RnAppState?.addEventListener?.("change", (state) => {
|
|
819
812
|
if (state === "active") void tick();
|
|
820
813
|
});
|
|
821
814
|
if (subscription) {
|
|
@@ -1537,7 +1530,7 @@ var Links = class {
|
|
|
1537
1530
|
};
|
|
1538
1531
|
|
|
1539
1532
|
// src/auto-track.ts
|
|
1540
|
-
import { AppState as
|
|
1533
|
+
import { AppState as RnAppState2 } from "react-native";
|
|
1541
1534
|
var DEFAULT_IDLE_MS = 30 * 60 * 1e3;
|
|
1542
1535
|
function resolveFlags(cfg) {
|
|
1543
1536
|
if (cfg === false) {
|
|
@@ -1581,7 +1574,7 @@ function installAutoTrack(args) {
|
|
|
1581
1574
|
args.fire("app.opened", { sessionId });
|
|
1582
1575
|
}
|
|
1583
1576
|
if (flags.appBackground) {
|
|
1584
|
-
const AppState =
|
|
1577
|
+
const AppState = RnAppState2;
|
|
1585
1578
|
if (AppState && typeof AppState.addEventListener === "function") {
|
|
1586
1579
|
const handler = (state) => {
|
|
1587
1580
|
ensureSession(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendoracloud/sdk-react-native",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "Sendora Cloud React Native + Expo SDK — analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|