修改优先级

This commit is contained in:
renhaoting 2025-12-30 17:53:53 +08:00
parent 1489be0c64
commit 37cbac1a2e
2 changed files with 4 additions and 1 deletions

View File

@ -82,7 +82,7 @@ object NotificationTriggerController {
// 常驻通知通道
val residentChannel = NotificationChannel(
CHANNEL_ID_RESIDENT, CHANNEL_NAME_RESIDENT, NotificationManager.IMPORTANCE_DEFAULT
CHANNEL_ID_RESIDENT, CHANNEL_NAME_RESIDENT, NotificationManager.IMPORTANCE_HIGH
).apply {
description = "for resident notification"
setShowBadge(false)
@ -344,6 +344,7 @@ object NotificationTriggerController {
.setSmallIcon(R.drawable.ic_noti_icon)
.setContentTitle(model.contentTitle)
.setContentText(model.contentContent)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setGroup(CHANNEL_ID_RESIDENT + model.notificationId)
.setContentIntent(model.contentIntent).setCustomContentView(model.contentView)
.setCustomBigContentView(model.contentView).setOngoing(true).setSilent(true).build()

View File

@ -390,6 +390,8 @@ class NotificationUtil private constructor() {
}
notificationManager.createNotificationChannel(channel)
}