From b24a7d9510c221c7ee685f3e68a213dc83ca8618 Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Tue, 27 Dec 2022 18:55:58 +0100 Subject: [PATCH] fix: Android push notification follow-up Signed-off-by: TheOneWithTheBraid --- lib/utils/push_helper.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/utils/push_helper.dart b/lib/utils/push_helper.dart index da26aa69..1ded6a05 100644 --- a/lib/utils/push_helper.dart +++ b/lib/utils/push_helper.dart @@ -60,6 +60,7 @@ Future pushHelper( ticker: l10n!.unreadChats(notification.counts?.unread ?? 1), importance: Importance.max, priority: Priority.high, + groupKey: notification.roomId, ), ), ); @@ -196,10 +197,16 @@ Future _tryPushHelper( messagingStyleInformation?.messages?.add(newMessage); final androidPlatformChannelSpecifics = AndroidNotificationDetails( - AppConfig.pushNotificationsChannelId, - AppConfig.pushNotificationsChannelName, - channelDescription: AppConfig.pushNotificationsChannelDescription, + notification.roomId ?? AppConfig.pushNotificationsChannelId, + notification.roomName ?? AppConfig.pushNotificationsChannelName, + channelDescription: + notification.roomName ?? AppConfig.pushNotificationsChannelDescription, + groupAlertBehavior: GroupAlertBehavior.summary, + category: AndroidNotificationCategory.message, number: notification.counts?.unread, + ticker: l10n.unreadChats(notification.counts?.unread ?? 1), + importance: Importance.max, + priority: Priority.high, styleInformation: messagingStyleInformation ?? MessagingStyleInformation( Person(name: event.room.client.userID), @@ -207,9 +214,6 @@ Future _tryPushHelper( groupConversation: !event.room.isDirectChat, messages: [newMessage], ), - ticker: l10n.unreadChats(notification.counts?.unread ?? 1), - importance: Importance.max, - priority: Priority.high, groupKey: event.room.id, ); const iOSPlatformChannelSpecifics = DarwinNotificationDetails();