@loyalytics/swan-react-native-sdk 2.7.1-beta.1 → 2.7.1-beta.2
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/lib/commonjs/index.js +10 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/index.js +10 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -1919,9 +1919,18 @@ class SwanSDK {
|
|
|
1919
1919
|
this.sendNotificationAck(messageId, 'clicked');
|
|
1920
1920
|
}
|
|
1921
1921
|
|
|
1922
|
+
// Normalize route: strip custom URL schemes (e.g., "swanexample://offer/999" → "offer/999")
|
|
1923
|
+
// iOS carousel routes must be full URLs for Content Extension's extensionContext.open(),
|
|
1924
|
+
// but host apps expect consistent relative routes across all platforms and notification types.
|
|
1925
|
+
// Preserve http:// and https:// — those are web links the host app may open in a browser.
|
|
1926
|
+
let normalizedRoute = route;
|
|
1927
|
+
if (normalizedRoute && normalizedRoute.includes('://') && !normalizedRoute.startsWith('http://') && !normalizedRoute.startsWith('https://')) {
|
|
1928
|
+
normalizedRoute = normalizedRoute.split('://').slice(1).join('://');
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1922
1931
|
// Emit NOTIFICATION_OPENED event (same as Notifee click handler)
|
|
1923
1932
|
const deepLinkPayload = {
|
|
1924
|
-
route:
|
|
1933
|
+
route: normalizedRoute || undefined,
|
|
1925
1934
|
title: title || undefined,
|
|
1926
1935
|
body: body || undefined,
|
|
1927
1936
|
keyValuePairs: {}
|