mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-08 08:12:37 +01:00
Merge branch 'malin/group-notification-channels' into 'main'
feat: Added grouping to message notification channels See merge request famedly/fluffychat!1134
This commit is contained in:
commit
ff5f7ab50e
@ -198,11 +198,33 @@ Future<void> _tryPushHelper(
|
|||||||
|
|
||||||
final roomName = event.room.getLocalizedDisplayname(MatrixLocals(l10n));
|
final roomName = event.room.getLocalizedDisplayname(MatrixLocals(l10n));
|
||||||
|
|
||||||
|
final notificationGroupId =
|
||||||
|
event.room.isDirectChat ? 'directChats' : 'groupChats';
|
||||||
|
final groupName = event.room.isDirectChat ? l10n.directChats : l10n.groups;
|
||||||
|
|
||||||
|
final messageRooms = AndroidNotificationChannelGroup(
|
||||||
|
notificationGroupId,
|
||||||
|
groupName,
|
||||||
|
);
|
||||||
|
final roomsChannel = AndroidNotificationChannel(
|
||||||
|
event.room.id,
|
||||||
|
roomName,
|
||||||
|
groupId: notificationGroupId,
|
||||||
|
);
|
||||||
|
|
||||||
|
await flutterLocalNotificationsPlugin
|
||||||
|
.resolvePlatformSpecificImplementation<
|
||||||
|
AndroidFlutterLocalNotificationsPlugin>()
|
||||||
|
?.createNotificationChannelGroup(messageRooms);
|
||||||
|
await flutterLocalNotificationsPlugin
|
||||||
|
.resolvePlatformSpecificImplementation<
|
||||||
|
AndroidFlutterLocalNotificationsPlugin>()
|
||||||
|
?.createNotificationChannel(roomsChannel);
|
||||||
|
|
||||||
final androidPlatformChannelSpecifics = AndroidNotificationDetails(
|
final androidPlatformChannelSpecifics = AndroidNotificationDetails(
|
||||||
event.room.id,
|
event.room.id,
|
||||||
roomName,
|
roomName,
|
||||||
channelDescription:
|
channelDescription: groupName,
|
||||||
event.room.isDirectChat ? l10n.directChats : l10n.groups,
|
|
||||||
number: notification.counts?.unread,
|
number: notification.counts?.unread,
|
||||||
category: AndroidNotificationCategory.message,
|
category: AndroidNotificationCategory.message,
|
||||||
styleInformation: messagingStyleInformation ??
|
styleInformation: messagingStyleInformation ??
|
||||||
@ -215,7 +237,7 @@ Future<void> _tryPushHelper(
|
|||||||
ticker: l10n.unreadChats(notification.counts?.unread ?? 1),
|
ticker: l10n.unreadChats(notification.counts?.unread ?? 1),
|
||||||
importance: Importance.max,
|
importance: Importance.max,
|
||||||
priority: Priority.max,
|
priority: Priority.max,
|
||||||
groupKey: event.room.id,
|
groupKey: notificationGroupId,
|
||||||
);
|
);
|
||||||
const iOSPlatformChannelSpecifics = DarwinNotificationDetails();
|
const iOSPlatformChannelSpecifics = DarwinNotificationDetails();
|
||||||
final platformChannelSpecifics = NotificationDetails(
|
final platformChannelSpecifics = NotificationDetails(
|
||||||
|
Loading…
Reference in New Issue
Block a user