@loyalytics/swan-react-native-sdk 2.5.1-beta.1 → 2.5.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/android/src/main/kotlin/com/loyalytics/swan/templates/carousel/CarouselTemplate.kt +14 -3
- package/lib/commonjs/version.js +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -84,7 +84,8 @@ class CarouselTemplate : SwanNotificationTemplate {
|
|
|
84
84
|
notificationId: Int,
|
|
85
85
|
messageId: String,
|
|
86
86
|
itemIndex: Int,
|
|
87
|
-
itemRoute: String
|
|
87
|
+
itemRoute: String,
|
|
88
|
+
isContentIntent: Boolean = false
|
|
88
89
|
): PendingIntent {
|
|
89
90
|
val launchIntent = context.packageManager.getLaunchIntentForPackage(context.packageName)
|
|
90
91
|
?: Intent(Intent.ACTION_MAIN).apply {
|
|
@@ -107,8 +108,15 @@ class CarouselTemplate : SwanNotificationTemplate {
|
|
|
107
108
|
PendingIntent.FLAG_UPDATE_CURRENT
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
// Use different request codes for image click vs content intent to prevent collision
|
|
112
|
+
val requestCode = if (isContentIntent) {
|
|
113
|
+
"${notificationId}CONTENT_CLICK".hashCode()
|
|
114
|
+
} else {
|
|
115
|
+
"$notificationId${ACTION_CLICK}$itemIndex".hashCode()
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
return PendingIntent.getActivity(
|
|
111
|
-
context,
|
|
119
|
+
context, requestCode, launchIntent, flags
|
|
112
120
|
)
|
|
113
121
|
}
|
|
114
122
|
}
|
|
@@ -447,13 +455,16 @@ class CarouselTemplate : SwanNotificationTemplate {
|
|
|
447
455
|
extras: Bundle
|
|
448
456
|
): PendingIntent {
|
|
449
457
|
// For CLICK, use PendingIntent.getActivity() to avoid Android 12+ trampoline restriction
|
|
458
|
+
// This is always the content intent (notification body tap) — image clicks go through
|
|
459
|
+
// createClickActivityPendingIntent() directly from RemoteViews builders
|
|
450
460
|
if (action == ACTION_CLICK) {
|
|
451
461
|
return createClickActivityPendingIntent(
|
|
452
462
|
context,
|
|
453
463
|
notificationId,
|
|
454
464
|
extras.getString(EXTRA_MESSAGE_ID, ""),
|
|
455
465
|
extras.getInt(EXTRA_ITEM_INDEX, 0),
|
|
456
|
-
extras.getString(EXTRA_ITEM_ROUTE, "")
|
|
466
|
+
extras.getString(EXTRA_ITEM_ROUTE, ""),
|
|
467
|
+
isContentIntent = true
|
|
457
468
|
)
|
|
458
469
|
}
|
|
459
470
|
|
package/lib/commonjs/version.js
CHANGED
|
@@ -8,5 +8,5 @@ exports.SDK_VERSION = void 0;
|
|
|
8
8
|
// This file is generated from package.json version during build.
|
|
9
9
|
// See scripts/generate-version.js
|
|
10
10
|
|
|
11
|
-
const SDK_VERSION = exports.SDK_VERSION = '2.5.1-beta.
|
|
11
|
+
const SDK_VERSION = exports.SDK_VERSION = '2.5.1-beta.2';
|
|
12
12
|
//# sourceMappingURL=version.js.map
|
package/lib/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.5.1-beta.
|
|
1
|
+
export declare const SDK_VERSION = "2.5.1-beta.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.5.1-beta.
|
|
1
|
+
export declare const SDK_VERSION = "2.5.1-beta.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|