From f3061569b100c5489a9d80b8a1f93f971af11abe Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 9 Dec 2025 11:30:05 +0000 Subject: [PATCH] feat: release --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ MainSDK.js | 24 +++++++++++++++--------- package.json | 2 +- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12b5f9a..e6e0a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +## 4.0.2 (2025-12-09) + + +* [DEV-359] feat!(main): support expo apps, rm native module. Kudos https://github.com/ahmetkuslular (dc9762c) + + +### Bug Fixes + +* **gcm:** message variability (544eb08) + + +### Features + +* **common:** bump version (ce7e70d) +* **sdk:** bump device-info (1d1f10e) +* **sdk:** getToken to use correct token (d07df14) +* **sdk:** in-app push notifications (#51) (6fa0296) +* **sdk:** include types for exclude_brands (#50) (cd1d301) +* **sdk:** rm jest (d0cce5d) +* **sdk:** sid token generation (4a34846) + + +### BREAKING CHANGES + +* rm react-native-device-info, dynamically import if +needed + + + ## 4.0.1 (2025-10-27) diff --git a/MainSDK.js b/MainSDK.js index 033b0cd..efb0013 100644 --- a/MainSDK.js +++ b/MainSDK.js @@ -502,21 +502,27 @@ class MainSDK extends Performer { setPushTokenNotification(token) { this.push(async () => { try { - const params = { - token: token, - platform: - this._push_type !== null - ? this._push_type - : token.match(/[a-z]/) !== null - ? 'android' - : 'ios', + let platform + + if (this._push_type !== null) { + platform = this._push_type + } else { + if (Platform.OS === 'ios') { + platform = 'ios' + } else { + platform = 'android' + } } + + if (DEBUG) console.log(`Push token platform: '${platform}'`) + return await request('mobile_push_tokens', this.shop_id, { method: 'POST', params: { shop_id: this.shop_id, stream: this.stream, - ...params, + token, + platform, }, }).then(async (data) => { if (data.status === 'success') { diff --git a/package.json b/package.json index 2c35a67..fcee70f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@personaclick/rn-sdk", - "version": "4.0.1", + "version": "4.0.2", "description": "PersonaClick React Native SDK", "type": "module", "exports": {