From e8170398e31cfdd33b0ccd630626fa4962e1912f Mon Sep 17 00:00:00 2001 From: KotlinGeekDev Date: Sat, 29 Jul 2023 15:46:13 +0100 Subject: [PATCH] Use the same group key, so the system groups automatically. --- .../amethyst/service/notifications/NotificationUtils.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationUtils.kt b/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationUtils.kt index 5e772035b..ceadddce4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationUtils.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationUtils.kt @@ -18,6 +18,7 @@ import com.vitorpamplona.amethyst.ui.MainActivity object NotificationUtils { private var dmChannel: NotificationChannel? = null private var zapChannel: NotificationChannel? = null + const val NOTIFICATION_GROUP_KEY = "com.vitorpamplona.amethyst.NOTIFICATION" private fun getOrCreateDMChannel(applicationContext: Context): NotificationChannel { if (dmChannel != null) return dmChannel!! @@ -164,7 +165,7 @@ object NotificationUtils { .setContentTitle(messageTitle) .setContentText(applicationContext.getString(R.string.app_notification_private_message)) .setLargeIcon(picture?.bitmap) - .setGroup(messageTitle) + .setGroup(NOTIFICATION_GROUP_KEY) .setContentIntent(contentPendingIntent) .setPriority(NotificationCompat.PRIORITY_HIGH) .setAutoCancel(true) @@ -178,7 +179,7 @@ object NotificationUtils { .setContentTitle(messageTitle) .setContentText(messageBody) .setLargeIcon(picture?.bitmap) - .setGroup(messageTitle) + .setGroup(NOTIFICATION_GROUP_KEY) .setContentIntent(contentPendingIntent) .setPublicVersion(builderPublic.build()) .setPriority(NotificationCompat.PRIORITY_HIGH)