fix(notification): minimize FGS notification visibility (bump channel to v2)
This commit is contained in:
parent
5c187db1f9
commit
ae3cf3e660
2 changed files with 7 additions and 1 deletions
|
|
@ -68,6 +68,8 @@ internal class MessagingService : Service() {
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setSilent(true)
|
.setSilent(true)
|
||||||
.setPriority(NotificationCompat.PRIORITY_MIN)
|
.setPriority(NotificationCompat.PRIORITY_MIN)
|
||||||
|
.setShowWhen(false)
|
||||||
|
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
|
||||||
.setContentIntent(openAppIntent)
|
.setContentIntent(openAppIntent)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,9 +83,11 @@ internal class NotificationHelper @Inject constructor(
|
||||||
description = "Hintergrunddienst für Nachrichten"
|
description = "Hintergrunddienst für Nachrichten"
|
||||||
setSound(null, null)
|
setSound(null, null)
|
||||||
enableVibration(false)
|
enableVibration(false)
|
||||||
|
setShowBadge(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
val manager = context.getSystemService(NotificationManager::class.java)
|
val manager = context.getSystemService(NotificationManager::class.java)
|
||||||
|
manager.deleteNotificationChannel("bollwerk_service") // Veralteter Channel – wird durch v2 ersetzt
|
||||||
manager.createNotificationChannel(channel)
|
manager.createNotificationChannel(channel)
|
||||||
manager.createNotificationChannel(serviceChannel)
|
manager.createNotificationChannel(serviceChannel)
|
||||||
}
|
}
|
||||||
|
|
@ -232,6 +234,8 @@ internal class NotificationHelper @Inject constructor(
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setSilent(true)
|
.setSilent(true)
|
||||||
.setPriority(NotificationCompat.PRIORITY_MIN)
|
.setPriority(NotificationCompat.PRIORITY_MIN)
|
||||||
|
.setShowWhen(false)
|
||||||
|
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
|
||||||
.setContentIntent(openAppIntent)
|
.setContentIntent(openAppIntent)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
@ -266,7 +270,7 @@ internal class NotificationHelper @Inject constructor(
|
||||||
companion object {
|
companion object {
|
||||||
const val CHANNEL_ID = "bollwerk_messages"
|
const val CHANNEL_ID = "bollwerk_messages"
|
||||||
private const val CHANNEL_NAME = "Chat-Nachrichten"
|
private const val CHANNEL_NAME = "Chat-Nachrichten"
|
||||||
const val SERVICE_CHANNEL_ID = "bollwerk_service"
|
const val SERVICE_CHANNEL_ID = "bollwerk_service_v2"
|
||||||
private const val SERVICE_CHANNEL_NAME = "Nachrichtendienst"
|
private const val SERVICE_CHANNEL_NAME = "Nachrichtendienst"
|
||||||
private const val MESSAGES_REQUEST_CODE = 1001
|
private const val MESSAGES_REQUEST_CODE = 1001
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue