slight improvements to windows and darwin notifs
This commit is contained in:
parent
4580110da0
commit
e24e99fd8e
2 changed files with 13 additions and 4 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ class UnifiedPushController extends AsyncNotifier<String?> {
|
|||
isGroup: !notification.isDm,
|
||||
sound: notification.sound,
|
||||
timestamp: notification.timestamp,
|
||||
threadId: notification.roomId,
|
||||
);
|
||||
|
||||
if (isInBackground) exit(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue