@sendoracloud/sdk-react-native 1.11.0 → 1.13.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/dist/index.cjs +37 -2
- package/dist/index.js +38 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -223,7 +223,7 @@ async function request(opts, method, path, body, extraHeaders, reqOpts) {
|
|
|
223
223
|
// package.json
|
|
224
224
|
var package_default = {
|
|
225
225
|
name: "@sendoracloud/sdk-react-native",
|
|
226
|
-
version: "1.
|
|
226
|
+
version: "1.13.0",
|
|
227
227
|
description: "Sendora Cloud React Native + Expo SDK \u2014 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`).",
|
|
228
228
|
type: "module",
|
|
229
229
|
main: "./dist/index.cjs",
|
|
@@ -2045,15 +2045,50 @@ function buildDeviceContext(appVersion) {
|
|
|
2045
2045
|
type: isPad ? "tablet" : "mobile",
|
|
2046
2046
|
os: os === "ios" ? "iOS" : "Android",
|
|
2047
2047
|
osVersion: String(import_react_native4.Platform.Version ?? ""),
|
|
2048
|
-
model:
|
|
2048
|
+
model: expoDeviceModel(),
|
|
2049
2049
|
appVersion: resolveAppVersion(appVersion)
|
|
2050
2050
|
};
|
|
2051
2051
|
} catch {
|
|
2052
2052
|
return void 0;
|
|
2053
2053
|
}
|
|
2054
2054
|
}
|
|
2055
|
+
function expoModule(name) {
|
|
2056
|
+
try {
|
|
2057
|
+
const g = globalThis;
|
|
2058
|
+
const m = g?.expo?.modules?.[name];
|
|
2059
|
+
if (m && typeof m === "object") return m;
|
|
2060
|
+
} catch {
|
|
2061
|
+
}
|
|
2062
|
+
try {
|
|
2063
|
+
const nm = import_react_native4.NativeModules;
|
|
2064
|
+
const m = nm?.[name];
|
|
2065
|
+
if (m && typeof m === "object") return m;
|
|
2066
|
+
} catch {
|
|
2067
|
+
}
|
|
2068
|
+
return void 0;
|
|
2069
|
+
}
|
|
2070
|
+
function expoNativeAppVersion() {
|
|
2071
|
+
const c = expoModule("ExponentConstants") ?? expoModule("ExpoConstants");
|
|
2072
|
+
if (!c) return "";
|
|
2073
|
+
if (typeof c.nativeAppVersion === "string" && c.nativeAppVersion) return c.nativeAppVersion;
|
|
2074
|
+
try {
|
|
2075
|
+
const raw = c.expoConfig ?? c.manifest ?? c.manifest2;
|
|
2076
|
+
const m = typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
2077
|
+
const v = m?.version;
|
|
2078
|
+
return typeof v === "string" ? v : "";
|
|
2079
|
+
} catch {
|
|
2080
|
+
return "";
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
function expoDeviceModel() {
|
|
2084
|
+
const d = expoModule("ExpoDevice");
|
|
2085
|
+
const v = d?.modelName;
|
|
2086
|
+
return typeof v === "string" ? v : "";
|
|
2087
|
+
}
|
|
2055
2088
|
function resolveAppVersion(configAppVersion) {
|
|
2056
2089
|
if (configAppVersion) return configAppVersion;
|
|
2090
|
+
const native = expoNativeAppVersion();
|
|
2091
|
+
if (native) return native;
|
|
2057
2092
|
try {
|
|
2058
2093
|
const env = process.env.EXPO_PUBLIC_APP_VERSION;
|
|
2059
2094
|
if (env) return env;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import "react-native-get-random-values";
|
|
3
|
-
import { Platform } from "react-native";
|
|
3
|
+
import { Platform, NativeModules } from "react-native";
|
|
4
4
|
|
|
5
5
|
// src/storage.ts
|
|
6
6
|
var PREFIX = "sendora_";
|
|
@@ -180,7 +180,7 @@ async function request(opts, method, path, body, extraHeaders, reqOpts) {
|
|
|
180
180
|
// package.json
|
|
181
181
|
var package_default = {
|
|
182
182
|
name: "@sendoracloud/sdk-react-native",
|
|
183
|
-
version: "1.
|
|
183
|
+
version: "1.13.0",
|
|
184
184
|
description: "Sendora Cloud React Native + Expo SDK \u2014 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`).",
|
|
185
185
|
type: "module",
|
|
186
186
|
main: "./dist/index.cjs",
|
|
@@ -2007,15 +2007,50 @@ function buildDeviceContext(appVersion) {
|
|
|
2007
2007
|
type: isPad ? "tablet" : "mobile",
|
|
2008
2008
|
os: os === "ios" ? "iOS" : "Android",
|
|
2009
2009
|
osVersion: String(Platform.Version ?? ""),
|
|
2010
|
-
model:
|
|
2010
|
+
model: expoDeviceModel(),
|
|
2011
2011
|
appVersion: resolveAppVersion(appVersion)
|
|
2012
2012
|
};
|
|
2013
2013
|
} catch {
|
|
2014
2014
|
return void 0;
|
|
2015
2015
|
}
|
|
2016
2016
|
}
|
|
2017
|
+
function expoModule(name) {
|
|
2018
|
+
try {
|
|
2019
|
+
const g = globalThis;
|
|
2020
|
+
const m = g?.expo?.modules?.[name];
|
|
2021
|
+
if (m && typeof m === "object") return m;
|
|
2022
|
+
} catch {
|
|
2023
|
+
}
|
|
2024
|
+
try {
|
|
2025
|
+
const nm = NativeModules;
|
|
2026
|
+
const m = nm?.[name];
|
|
2027
|
+
if (m && typeof m === "object") return m;
|
|
2028
|
+
} catch {
|
|
2029
|
+
}
|
|
2030
|
+
return void 0;
|
|
2031
|
+
}
|
|
2032
|
+
function expoNativeAppVersion() {
|
|
2033
|
+
const c = expoModule("ExponentConstants") ?? expoModule("ExpoConstants");
|
|
2034
|
+
if (!c) return "";
|
|
2035
|
+
if (typeof c.nativeAppVersion === "string" && c.nativeAppVersion) return c.nativeAppVersion;
|
|
2036
|
+
try {
|
|
2037
|
+
const raw = c.expoConfig ?? c.manifest ?? c.manifest2;
|
|
2038
|
+
const m = typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
2039
|
+
const v = m?.version;
|
|
2040
|
+
return typeof v === "string" ? v : "";
|
|
2041
|
+
} catch {
|
|
2042
|
+
return "";
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
function expoDeviceModel() {
|
|
2046
|
+
const d = expoModule("ExpoDevice");
|
|
2047
|
+
const v = d?.modelName;
|
|
2048
|
+
return typeof v === "string" ? v : "";
|
|
2049
|
+
}
|
|
2017
2050
|
function resolveAppVersion(configAppVersion) {
|
|
2018
2051
|
if (configAppVersion) return configAppVersion;
|
|
2052
|
+
const native = expoNativeAppVersion();
|
|
2053
|
+
if (native) return native;
|
|
2019
2054
|
try {
|
|
2020
2055
|
const env = process.env.EXPO_PUBLIC_APP_VERSION;
|
|
2021
2056
|
if (env) return env;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendoracloud/sdk-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
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",
|