diff --git a/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt b/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt index 7913693..068426d 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt @@ -345,10 +345,17 @@ class NotificationService(val context: Context) { } else -> NotificationChannel(toChannelId(name, priority), context.getString(R.string.channel_notifications_default_name), NotificationManager.IMPORTANCE_DEFAULT) } + maybeCreateNotificationChannelGroup(DEFAULT_GROUP_ID, context.getString(R.string.channel_notifications_group_default_name)) + channel.setGroup(DEFAULT_GROUP_ID) + notificationManager.createNotificationChannel(channel) } } + private fun maybeCreateNotificationChannelGroup(id: String, name: String) { + notificationManager.createNotificationChannelGroup(NotificationChannelGroup(id, name)) + } + private fun toChannelId(name: String, priority: Int): String { return when (priority) { 1 -> name + PRIORITY_MIN @@ -416,6 +423,7 @@ class NotificationService(val context: Context) { private const val TAG = "NtfyNotifService" private const val DEFAULT_CHANNEL = "ntfy" + private const val DEFAULT_GROUP_ID = "ntfy" private const val PRIORITY_MIN = "-min" private const val PRIORITY_LOW = "-low" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 59c9817..ee42d95 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -7,6 +7,7 @@ Notifications (default priority) Notifications (high priority) Notifications (max priority) + Standard Subscription Service Listening for incoming notifications Subscribed to instant delivery topics