@sendoracloud/sdk-react-native 0.17.0 → 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/dist/index.cjs CHANGED
@@ -848,6 +848,7 @@ function decodeJwtPayload(token) {
848
848
  }
849
849
 
850
850
  // src/links.ts
851
+ var import_react_native = require("react-native");
851
852
  var LinkError = class extends Error {
852
853
  constructor(code, message, statusCode = 0, details) {
853
854
  super(message);
@@ -925,7 +926,12 @@ function dynRequire(id) {
925
926
  }
926
927
  }
927
928
  function loadRn() {
928
- return dynRequire("react-native");
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
+ };
929
935
  }
930
936
  function readTimezone() {
931
937
  try {
@@ -1406,6 +1412,7 @@ var Links = class {
1406
1412
  };
1407
1413
 
1408
1414
  // src/auto-track.ts
1415
+ var import_react_native2 = require("react-native");
1409
1416
  var DEFAULT_IDLE_MS = 30 * 60 * 1e3;
1410
1417
  function resolveFlags(cfg) {
1411
1418
  if (cfg === false) {
@@ -1449,14 +1456,7 @@ function installAutoTrack(args) {
1449
1456
  args.fire("app.opened", { sessionId });
1450
1457
  }
1451
1458
  if (flags.appBackground) {
1452
- let AppState = null;
1453
- try {
1454
- const dyn = globalThis.require;
1455
- const mod = dyn ? dyn("react-native") : null;
1456
- AppState = mod?.AppState ?? null;
1457
- } catch {
1458
- AppState = null;
1459
- }
1459
+ const AppState = import_react_native2.AppState;
1460
1460
  if (AppState && typeof AppState.addEventListener === "function") {
1461
1461
  const handler = (state) => {
1462
1462
  ensureSession(true);
package/dist/index.js CHANGED
@@ -805,6 +805,12 @@ function decodeJwtPayload(token) {
805
805
  }
806
806
 
807
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";
808
814
  var LinkError = class extends Error {
809
815
  constructor(code, message, statusCode = 0, details) {
810
816
  super(message);
@@ -882,7 +888,12 @@ function dynRequire(id) {
882
888
  }
883
889
  }
884
890
  function loadRn() {
885
- return dynRequire("react-native");
891
+ return {
892
+ Platform: RnPlatform,
893
+ Dimensions: RnDimensions,
894
+ NativeModules: RnNativeModules,
895
+ Linking: RnLinking
896
+ };
886
897
  }
887
898
  function readTimezone() {
888
899
  try {
@@ -1363,6 +1374,7 @@ var Links = class {
1363
1374
  };
1364
1375
 
1365
1376
  // src/auto-track.ts
1377
+ import { AppState as RnAppState } from "react-native";
1366
1378
  var DEFAULT_IDLE_MS = 30 * 60 * 1e3;
1367
1379
  function resolveFlags(cfg) {
1368
1380
  if (cfg === false) {
@@ -1406,14 +1418,7 @@ function installAutoTrack(args) {
1406
1418
  args.fire("app.opened", { sessionId });
1407
1419
  }
1408
1420
  if (flags.appBackground) {
1409
- let AppState = null;
1410
- try {
1411
- const dyn = globalThis.require;
1412
- const mod = dyn ? dyn("react-native") : null;
1413
- AppState = mod?.AppState ?? null;
1414
- } catch {
1415
- AppState = null;
1416
- }
1421
+ const AppState = RnAppState;
1417
1422
  if (AppState && typeof AppState.addEventListener === "function") {
1418
1423
  const handler = (state) => {
1419
1424
  ensureSession(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "0.17.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",