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 isGroup = false,
|
||||||
bool sound = true,
|
bool sound = true,
|
||||||
DateTime? timestamp,
|
DateTime? timestamp,
|
||||||
|
String? threadId,
|
||||||
}) async {
|
}) async {
|
||||||
debugPrint("Sending notification for $id");
|
debugPrint("Sending notification for $id");
|
||||||
|
|
||||||
|
|
@ -160,7 +161,10 @@ class NotificationController
|
||||||
.onError((_, _) => null)
|
.onError((_, _) => null)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
final darwin = DarwinNotificationDetails(presentSound: sound);
|
final darwin = DarwinNotificationDetails(
|
||||||
|
presentSound: sound,
|
||||||
|
threadIdentifier: threadId,
|
||||||
|
);
|
||||||
final notificationDetails = NotificationDetails(
|
final notificationDetails = NotificationDetails(
|
||||||
android: .new(
|
android: .new(
|
||||||
"messages",
|
"messages",
|
||||||
|
|
@ -188,11 +192,15 @@ class NotificationController
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// TODO: See if icons can be added to iOS, macOS, and Windows
|
|
||||||
// notifications (#68)
|
|
||||||
iOS: darwin,
|
iOS: darwin,
|
||||||
macOS: 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(
|
await controller.show(
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ class UnifiedPushController extends AsyncNotifier<String?> {
|
||||||
isGroup: !notification.isDm,
|
isGroup: !notification.isDm,
|
||||||
sound: notification.sound,
|
sound: notification.sound,
|
||||||
timestamp: notification.timestamp,
|
timestamp: notification.timestamp,
|
||||||
|
threadId: notification.roomId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isInBackground) exit(0);
|
if (isInBackground) exit(0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue