@sendoracloud/sdk-react-native 0.18.8 → 0.18.9

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
@@ -1830,7 +1830,7 @@ var SendoraSDK = class {
1830
1830
  throw new Error("[sendoracloud] push token metadata exceeds 4KB.");
1831
1831
  }
1832
1832
  }
1833
- const data = await post(
1833
+ const res = await post(
1834
1834
  { apiUrl: this.config.apiUrl, publicKey: this.config.publicKey, debug: this.debug },
1835
1835
  "/api/v1/push/tokens",
1836
1836
  {
@@ -1843,6 +1843,11 @@ var SendoraSDK = class {
1843
1843
  metadata: reg.metadata ?? {}
1844
1844
  }
1845
1845
  );
1846
+ if (!res || !res.ok) {
1847
+ throw new Error(`[sendoracloud] push token registration failed (HTTP ${res?.status ?? "network"}).`);
1848
+ }
1849
+ const parsed = await res.json();
1850
+ const data = parsed?.data;
1846
1851
  if (!data?.tokenId) {
1847
1852
  throw new Error("[sendoracloud] push token registered but server returned no tokenId \u2014 upgrade backend to >= s58.16.");
1848
1853
  }
package/dist/index.js CHANGED
@@ -1792,7 +1792,7 @@ var SendoraSDK = class {
1792
1792
  throw new Error("[sendoracloud] push token metadata exceeds 4KB.");
1793
1793
  }
1794
1794
  }
1795
- const data = await post(
1795
+ const res = await post(
1796
1796
  { apiUrl: this.config.apiUrl, publicKey: this.config.publicKey, debug: this.debug },
1797
1797
  "/api/v1/push/tokens",
1798
1798
  {
@@ -1805,6 +1805,11 @@ var SendoraSDK = class {
1805
1805
  metadata: reg.metadata ?? {}
1806
1806
  }
1807
1807
  );
1808
+ if (!res || !res.ok) {
1809
+ throw new Error(`[sendoracloud] push token registration failed (HTTP ${res?.status ?? "network"}).`);
1810
+ }
1811
+ const parsed = await res.json();
1812
+ const data = parsed?.data;
1808
1813
  if (!data?.tokenId) {
1809
1814
  throw new Error("[sendoracloud] push token registered but server returned no tokenId \u2014 upgrade backend to >= s58.16.");
1810
1815
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "0.18.8",
3
+ "version": "0.18.9",
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",