diff --git a/features/notifications/src/main/kotlin/app/dapk/st/notifications/NotificationChannels.kt b/features/notifications/src/main/kotlin/app/dapk/st/notifications/NotificationChannels.kt index 80e49da..676d968 100644 --- a/features/notifications/src/main/kotlin/app/dapk/st/notifications/NotificationChannels.kt +++ b/features/notifications/src/main/kotlin/app/dapk/st/notifications/NotificationChannels.kt @@ -2,6 +2,7 @@ package app.dapk.st.notifications import android.app.NotificationChannel import android.app.NotificationManager +import android.os.Build private const val channelId = "message" @@ -10,14 +11,16 @@ class NotificationChannels( ) { fun initChannels() { - if (notificationManager.getNotificationChannel(channelId) == null) { - notificationManager.createNotificationChannel( - NotificationChannel( - channelId, - "messages", - NotificationManager.IMPORTANCE_HIGH, + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (notificationManager.getNotificationChannel(channelId) == null) { + notificationManager.createNotificationChannel( + NotificationChannel( + channelId, + "messages", + NotificationManager.IMPORTANCE_HIGH, + ) ) - ) + } } }