From db43b1ffea5908c3f6ea0738765ce655740ec836 Mon Sep 17 00:00:00 2001 From: S1m Date: Tue, 16 Jan 2024 20:00:28 +0100 Subject: [PATCH] Do not replace in-app notif from channel --- .../distributor/nextpush/utils/Notifications.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/utils/Notifications.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/utils/Notifications.kt index 055e74c..3b1645f 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/utils/Notifications.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/utils/Notifications.kt @@ -15,13 +15,13 @@ import org.unifiedpush.distributor.nextpush.R import org.unifiedpush.distributor.nextpush.activities.MainActivity import org.unifiedpush.distributor.nextpush.services.RegistrationCountCache import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicInteger const val NOTIFICATION_ID_FOREGROUND = 51115 const val NOTIFICATION_ID_WARNING = 51215 const val NOTIFICATION_ID_NO_START = 51315 const val NOTIFICATION_ID_LOW_KEEPALIVE = 51315 const val NOTIFICATION_ID_NO_PING = 51515 -const val NOTIFICATION_ID_FROM_PUSH = 51615 data class ChannelData( val id: String, @@ -244,7 +244,7 @@ class ForegroundNotification(context: Context) : AppNotification( class FromPushNotification(context: Context, title: String, content: String) : AppNotification( context, - NOTIFICATION_ID_FROM_PUSH, + Notifications.nextNotificationId.getAndIncrement(), NotificationData( title, content, @@ -253,9 +253,13 @@ class FromPushNotification(context: Context, title: String, content: String) : A false ), ChannelData( - "${context.getString(R.string.app_name)}.PushNotification", - "Push notifications", + "${context.getString(R.string.app_name)}.Push.$title", + "(Push) $title", NotificationManager.IMPORTANCE_HIGH, context.getString(R.string.local_notif_description) ) ) + +private object Notifications { + val nextNotificationId = AtomicInteger(50000) +}