Use the same group key, so the system groups automatically.
This commit is contained in:
+3
-2
@@ -18,6 +18,7 @@ import com.vitorpamplona.amethyst.ui.MainActivity
|
|||||||
object NotificationUtils {
|
object NotificationUtils {
|
||||||
private var dmChannel: NotificationChannel? = null
|
private var dmChannel: NotificationChannel? = null
|
||||||
private var zapChannel: NotificationChannel? = null
|
private var zapChannel: NotificationChannel? = null
|
||||||
|
const val NOTIFICATION_GROUP_KEY = "com.vitorpamplona.amethyst.NOTIFICATION"
|
||||||
|
|
||||||
private fun getOrCreateDMChannel(applicationContext: Context): NotificationChannel {
|
private fun getOrCreateDMChannel(applicationContext: Context): NotificationChannel {
|
||||||
if (dmChannel != null) return dmChannel!!
|
if (dmChannel != null) return dmChannel!!
|
||||||
@@ -164,7 +165,7 @@ object NotificationUtils {
|
|||||||
.setContentTitle(messageTitle)
|
.setContentTitle(messageTitle)
|
||||||
.setContentText(applicationContext.getString(R.string.app_notification_private_message))
|
.setContentText(applicationContext.getString(R.string.app_notification_private_message))
|
||||||
.setLargeIcon(picture?.bitmap)
|
.setLargeIcon(picture?.bitmap)
|
||||||
.setGroup(messageTitle)
|
.setGroup(NOTIFICATION_GROUP_KEY)
|
||||||
.setContentIntent(contentPendingIntent)
|
.setContentIntent(contentPendingIntent)
|
||||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
@@ -178,7 +179,7 @@ object NotificationUtils {
|
|||||||
.setContentTitle(messageTitle)
|
.setContentTitle(messageTitle)
|
||||||
.setContentText(messageBody)
|
.setContentText(messageBody)
|
||||||
.setLargeIcon(picture?.bitmap)
|
.setLargeIcon(picture?.bitmap)
|
||||||
.setGroup(messageTitle)
|
.setGroup(NOTIFICATION_GROUP_KEY)
|
||||||
.setContentIntent(contentPendingIntent)
|
.setContentIntent(contentPendingIntent)
|
||||||
.setPublicVersion(builderPublic.build())
|
.setPublicVersion(builderPublic.build())
|
||||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||||
|
|||||||
Reference in New Issue
Block a user