diff --git a/app/src/main/kotlin/com/wire/android/notification/MessageNotificationManager.kt b/app/src/main/kotlin/com/wire/android/notification/MessageNotificationManager.kt index 99f2de18724..6f109b61561 100644 --- a/app/src/main/kotlin/com/wire/android/notification/MessageNotificationManager.kt +++ b/app/src/main/kotlin/com/wire/android/notification/MessageNotificationManager.kt @@ -486,7 +486,7 @@ class MessageNotificationManager messagesStyle.addMessage(replyMessage) } - val notification = setUpNotificationBuilder(context, userId).apply { + val notification = setUpNotificationBuilder(context, userId, true).apply { setContentIntent(messagePendingIntent(context, conversationId, userIdString)) addAction(getActionReply(context, conversationId, userIdString, false)) @@ -506,13 +506,19 @@ class MessageNotificationManager /** * Create NotificationBuilder and set all the parameters that are common for any MessageNotification + * use [setOnlyAlertOnce] to trigger only once sound and vibrations for notification updates * @return resulted [NotificationCompat.Builder] so we can set other specific parameters and build it. */ - private fun setUpNotificationBuilder(context: Context, userId: QualifiedID): NotificationCompat.Builder { + private fun setUpNotificationBuilder( + context: Context, + userId: QualifiedID, + setOnlyAlertOnce: Boolean = false + ): NotificationCompat.Builder { val channelId = NotificationConstants.getMessagesChannelId(userId) + return NotificationCompat.Builder(context, channelId).apply { setDefaults(NotificationCompat.DEFAULT_ALL) - + setOnlyAlertOnce(setOnlyAlertOnce) priority = NotificationCompat.PRIORITY_MAX setCategory(NotificationCompat.CATEGORY_MESSAGE) diff --git a/app/src/main/kotlin/com/wire/android/notification/NotificationConstants.kt b/app/src/main/kotlin/com/wire/android/notification/NotificationConstants.kt index 62c13a83653..4ec6ca2adb6 100644 --- a/app/src/main/kotlin/com/wire/android/notification/NotificationConstants.kt +++ b/app/src/main/kotlin/com/wire/android/notification/NotificationConstants.kt @@ -33,6 +33,7 @@ object NotificationConstants { private const val MESSAGE_CHANNEL_ID = "com.wire.android.notification_channel" const val MESSAGE_CHANNEL_NAME = "Messages" + private const val PING_CHANNEL_ID = "com.wire.android.notification_ping_channel" const val PING_CHANNEL_NAME = "Pings" private const val MESSAGE_GROUP_KEY_PREFIX = "wire_reloaded_notification_group_"