Вот мой код для создания канала:
Код: Выделить всё
private fun createNextPrayerNotificationChannel(): NotificationChannel {
return NotificationChannel(
Unique.NAME_NEXT_PRAYER_CHANNEL,
getString(R.string.next_prayer_channel),
NotificationManager.IMPORTANCE_HIGH
)
}
Код: Выделить всё
return NotificationCompat.Builder(this, Unique.NAME_NEXT_PRAYER_CHANNEL)
.setOnlyAlertOnce(true)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setStyle(NotificationCompat.BigTextStyle())
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent)
.setCustomContentView(contentView)
.setCustomBigContentView(contentView)
.build()
Подробнее здесь: https://stackoverflow.com/questions/788 ... android-12
Мобильная версия