diff --git a/lib/controllers/notification.dart b/lib/controllers/notification.dart index 4016a2c..7b5d2b8 100644 --- a/lib/controllers/notification.dart +++ b/lib/controllers/notification.dart @@ -116,6 +116,7 @@ class NotificationController bool isGroup = false, bool sound = true, DateTime? timestamp, + String? threadId, }) async { debugPrint("Sending notification for $id"); @@ -160,7 +161,10 @@ class NotificationController .onError((_, _) => null) : null; - final darwin = DarwinNotificationDetails(presentSound: sound); + final darwin = DarwinNotificationDetails( + presentSound: sound, + threadIdentifier: threadId, + ); final notificationDetails = NotificationDetails( android: .new( "messages", @@ -188,11 +192,15 @@ class NotificationController ], ), ), - // TODO: See if icons can be added to iOS, macOS, and Windows - // notifications (#68) iOS: darwin, macOS: darwin, - windows: .new(audio: sound ? null : .silent()), + windows: .new( + audio: sound ? null : .silent(), + timestamp: timestamp, + header: threadId == null + ? null + : .new(id: threadId, title: title, arguments: payload ?? ""), + ), ); await controller.show( diff --git a/lib/controllers/unified_push.dart b/lib/controllers/unified_push.dart index 87ec4e8..333ecc6 100644 --- a/lib/controllers/unified_push.dart +++ b/lib/controllers/unified_push.dart @@ -127,6 +127,7 @@ class UnifiedPushController extends AsyncNotifier { isGroup: !notification.isDm, sound: notification.sound, timestamp: notification.timestamp, + threadId: notification.roomId, ); if (isInBackground) exit(0);