@sendoracloud/sdk-react-native 0.16.2 → 0.17.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/README.md +3 -9
- package/dist/index.cjs +10 -9
- package/dist/index.js +17 -9
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -32,19 +32,13 @@ Or use EAS Build for cloud builds. **Auth, analytics, deep links all work fine i
|
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
npx expo install @sendoracloud/sdk-react-native @react-native-async-storage/async-storage
|
|
35
|
-
npm install react-native-get-random-values
|
|
36
35
|
```
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
That's it. Since 0.17.0 the SDK bundles `react-native-get-random-values` as a hard dependency and auto-applies the polyfill at SDK load — no manual `import "react-native-get-random-values"` in your entry file required.
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
`@react-native-async-storage/async-storage` is a required peer dependency used to persist the anonymous device id across app restarts.
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
// MUST be the first import in your entry file
|
|
44
|
-
import "react-native-get-random-values";
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
If you forget, `init()` throws with a paste-ready remediation block — it never fails silently.
|
|
41
|
+
> **Upgrading from 0.16.x?** You can delete the `import "react-native-get-random-values";` line from your `index.js` / `index.tsx` entry file — it's now a no-op (the SDK side-effect-loads the polyfill itself). Leaving it in does no harm.
|
|
48
42
|
|
|
49
43
|
### Optional peers (deep links)
|
|
50
44
|
|
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(index_exports, {
|
|
|
42
42
|
getPlayInstallReferrer: () => getPlayInstallReferrer
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(index_exports);
|
|
45
|
+
var import_react_native_get_random_values = require("react-native-get-random-values");
|
|
45
46
|
|
|
46
47
|
// src/storage.ts
|
|
47
48
|
var PREFIX = "sendora_";
|
|
@@ -847,6 +848,7 @@ function decodeJwtPayload(token) {
|
|
|
847
848
|
}
|
|
848
849
|
|
|
849
850
|
// src/links.ts
|
|
851
|
+
var import_react_native = require("react-native");
|
|
850
852
|
var LinkError = class extends Error {
|
|
851
853
|
constructor(code, message, statusCode = 0, details) {
|
|
852
854
|
super(message);
|
|
@@ -924,7 +926,12 @@ function dynRequire(id) {
|
|
|
924
926
|
}
|
|
925
927
|
}
|
|
926
928
|
function loadRn() {
|
|
927
|
-
return
|
|
929
|
+
return {
|
|
930
|
+
Platform: import_react_native.Platform,
|
|
931
|
+
Dimensions: import_react_native.Dimensions,
|
|
932
|
+
NativeModules: import_react_native.NativeModules,
|
|
933
|
+
Linking: import_react_native.Linking
|
|
934
|
+
};
|
|
928
935
|
}
|
|
929
936
|
function readTimezone() {
|
|
930
937
|
try {
|
|
@@ -1405,6 +1412,7 @@ var Links = class {
|
|
|
1405
1412
|
};
|
|
1406
1413
|
|
|
1407
1414
|
// src/auto-track.ts
|
|
1415
|
+
var import_react_native2 = require("react-native");
|
|
1408
1416
|
var DEFAULT_IDLE_MS = 30 * 60 * 1e3;
|
|
1409
1417
|
function resolveFlags(cfg) {
|
|
1410
1418
|
if (cfg === false) {
|
|
@@ -1448,14 +1456,7 @@ function installAutoTrack(args) {
|
|
|
1448
1456
|
args.fire("app.opened", { sessionId });
|
|
1449
1457
|
}
|
|
1450
1458
|
if (flags.appBackground) {
|
|
1451
|
-
|
|
1452
|
-
try {
|
|
1453
|
-
const dyn = globalThis.require;
|
|
1454
|
-
const mod = dyn ? dyn("react-native") : null;
|
|
1455
|
-
AppState = mod?.AppState ?? null;
|
|
1456
|
-
} catch {
|
|
1457
|
-
AppState = null;
|
|
1458
|
-
}
|
|
1459
|
+
const AppState = import_react_native2.AppState;
|
|
1459
1460
|
if (AppState && typeof AppState.addEventListener === "function") {
|
|
1460
1461
|
const handler = (state) => {
|
|
1461
1462
|
ensureSession(true);
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import "react-native-get-random-values";
|
|
3
|
+
|
|
1
4
|
// src/storage.ts
|
|
2
5
|
var PREFIX = "sendora_";
|
|
3
6
|
var asyncStoragePromise = null;
|
|
@@ -802,6 +805,12 @@ function decodeJwtPayload(token) {
|
|
|
802
805
|
}
|
|
803
806
|
|
|
804
807
|
// src/links.ts
|
|
808
|
+
import {
|
|
809
|
+
Dimensions as RnDimensions,
|
|
810
|
+
Linking as RnLinking,
|
|
811
|
+
NativeModules as RnNativeModules,
|
|
812
|
+
Platform as RnPlatform
|
|
813
|
+
} from "react-native";
|
|
805
814
|
var LinkError = class extends Error {
|
|
806
815
|
constructor(code, message, statusCode = 0, details) {
|
|
807
816
|
super(message);
|
|
@@ -879,7 +888,12 @@ function dynRequire(id) {
|
|
|
879
888
|
}
|
|
880
889
|
}
|
|
881
890
|
function loadRn() {
|
|
882
|
-
return
|
|
891
|
+
return {
|
|
892
|
+
Platform: RnPlatform,
|
|
893
|
+
Dimensions: RnDimensions,
|
|
894
|
+
NativeModules: RnNativeModules,
|
|
895
|
+
Linking: RnLinking
|
|
896
|
+
};
|
|
883
897
|
}
|
|
884
898
|
function readTimezone() {
|
|
885
899
|
try {
|
|
@@ -1360,6 +1374,7 @@ var Links = class {
|
|
|
1360
1374
|
};
|
|
1361
1375
|
|
|
1362
1376
|
// src/auto-track.ts
|
|
1377
|
+
import { AppState as RnAppState } from "react-native";
|
|
1363
1378
|
var DEFAULT_IDLE_MS = 30 * 60 * 1e3;
|
|
1364
1379
|
function resolveFlags(cfg) {
|
|
1365
1380
|
if (cfg === false) {
|
|
@@ -1403,14 +1418,7 @@ function installAutoTrack(args) {
|
|
|
1403
1418
|
args.fire("app.opened", { sessionId });
|
|
1404
1419
|
}
|
|
1405
1420
|
if (flags.appBackground) {
|
|
1406
|
-
|
|
1407
|
-
try {
|
|
1408
|
-
const dyn = globalThis.require;
|
|
1409
|
-
const mod = dyn ? dyn("react-native") : null;
|
|
1410
|
-
AppState = mod?.AppState ?? null;
|
|
1411
|
-
} catch {
|
|
1412
|
-
AppState = null;
|
|
1413
|
-
}
|
|
1421
|
+
const AppState = RnAppState;
|
|
1414
1422
|
if (AppState && typeof AppState.addEventListener === "function") {
|
|
1415
1423
|
const handler = (state) => {
|
|
1416
1424
|
ensureSession(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendoracloud/sdk-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"tracking",
|
|
28
28
|
"customer-engagement"
|
|
29
29
|
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"react-native-get-random-values": "^1.11.0"
|
|
32
|
+
},
|
|
30
33
|
"peerDependencies": {
|
|
31
34
|
"@react-native-async-storage/async-storage": ">=1.17.0",
|
|
32
35
|
"react-native": ">=0.70.0"
|