Merge pull request #2397 from Bnyro/master

Fix issues with notification groups being empty
This commit is contained in:
Bnyro 2022-12-16 15:20:13 +01:00 committed by GitHub
commit b0a0fb5ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,6 @@ class NotificationWorker(appContext: Context, parameters: WorkerParameters) :
)
streams.forEach { streamItem ->
notificationId += 1
createNotification(
title = streamItem.title.toString(),
description = streamItem.uploaderName.toString(),
@ -152,13 +151,15 @@ class NotificationWorker(appContext: Context, parameters: WorkerParameters) :
description: String? = null,
isSummary: Boolean = false
) {
val intent = Intent(applicationContext, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
}
// increase the notification ID to guarantee uniqueness
notificationId += 1
val pendingIntent: PendingIntent = PendingIntent.getActivity(
applicationContext,
0,
intent,
Intent(applicationContext, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
},
PendingIntent.FLAG_IMMUTABLE
)