File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
android/app/src/main/java/chat/rocket/reactnative/notification Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,20 @@ class NotificationIntentHandler {
9393 }
9494
9595 try {
96+ val notId = extras.getString(" notId" )
97+
98+ // Clear the notification messages from the static map to prevent stacking
99+ if (! notId.isNullOrEmpty()) {
100+ try {
101+ val notIdInt = notId.toIntOrNull()
102+ if (notIdInt != null ) {
103+ CustomPushNotification .clearMessages(notIdInt)
104+ }
105+ } catch (e: Exception ) {
106+ Log .e(TAG , " Error clearing notification messages for ID $notId : ${e.message} " , e)
107+ }
108+ }
109+
96110 // Extract all notification data from Intent extras
97111 // Only include serializable types to avoid JSON serialization errors
98112 val notificationData = mutableMapOf<String , Any ?>()
You can’t perform that action at this time.
0 commit comments