@sendoracloud/sdk-react-native 1.12.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 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.12.0",
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,27 +2045,46 @@ 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 expoNativeAppVersion() {
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
+ }
2056
2062
  try {
2057
2063
  const nm = import_react_native4.NativeModules;
2058
- const c = nm?.ExponentConstants ?? nm?.ExpoConstants;
2059
- if (!c) return "";
2060
- if (typeof c.nativeAppVersion === "string" && c.nativeAppVersion) return c.nativeAppVersion;
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 {
2061
2075
  const raw = c.expoConfig ?? c.manifest ?? c.manifest2;
2062
2076
  const m = typeof raw === "string" ? JSON.parse(raw) : raw;
2063
- const v = m?.version ?? m?.extra?.expoClient?.version;
2077
+ const v = m?.version;
2064
2078
  return typeof v === "string" ? v : "";
2065
2079
  } catch {
2066
2080
  return "";
2067
2081
  }
2068
2082
  }
2083
+ function expoDeviceModel() {
2084
+ const d = expoModule("ExpoDevice");
2085
+ const v = d?.modelName;
2086
+ return typeof v === "string" ? v : "";
2087
+ }
2069
2088
  function resolveAppVersion(configAppVersion) {
2070
2089
  if (configAppVersion) return configAppVersion;
2071
2090
  const native = expoNativeAppVersion();
package/dist/index.js CHANGED
@@ -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.12.0",
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,27 +2007,46 @@ 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 expoNativeAppVersion() {
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
+ }
2018
2024
  try {
2019
2025
  const nm = NativeModules;
2020
- const c = nm?.ExponentConstants ?? nm?.ExpoConstants;
2021
- if (!c) return "";
2022
- if (typeof c.nativeAppVersion === "string" && c.nativeAppVersion) return c.nativeAppVersion;
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 {
2023
2037
  const raw = c.expoConfig ?? c.manifest ?? c.manifest2;
2024
2038
  const m = typeof raw === "string" ? JSON.parse(raw) : raw;
2025
- const v = m?.version ?? m?.extra?.expoClient?.version;
2039
+ const v = m?.version;
2026
2040
  return typeof v === "string" ? v : "";
2027
2041
  } catch {
2028
2042
  return "";
2029
2043
  }
2030
2044
  }
2045
+ function expoDeviceModel() {
2046
+ const d = expoModule("ExpoDevice");
2047
+ const v = d?.modelName;
2048
+ return typeof v === "string" ? v : "";
2049
+ }
2031
2050
  function resolveAppVersion(configAppVersion) {
2032
2051
  if (configAppVersion) return configAppVersion;
2033
2052
  const native = expoNativeAppVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "1.12.0",
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",