forked from Nexus/nexus
high importance and high priority for notifications
This commit is contained in:
parent
322217fc20
commit
23d77ddc60
1 changed files with 13 additions and 2 deletions
|
|
@ -48,6 +48,12 @@ class NotificationController
|
||||||
if (details.payload case final payload?) _open(payload);
|
if (details.payload case final payload?) _open(payload);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await notifications
|
||||||
|
.resolvePlatformSpecificImplementation<
|
||||||
|
AndroidFlutterLocalNotificationsPlugin
|
||||||
|
>()
|
||||||
|
?.deleteNotificationChannel(channelId: "messages");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Platform.isLinux) {
|
if (Platform.isLinux) {
|
||||||
|
|
@ -93,6 +99,8 @@ class NotificationController
|
||||||
|
|
||||||
static const _androidGroup = "nexus.federated.nexus.MESSAGES";
|
static const _androidGroup = "nexus.federated.nexus.MESSAGES";
|
||||||
static const _summaryPayload = "summary";
|
static const _summaryPayload = "summary";
|
||||||
|
|
||||||
|
static const _messagesChannel = "messages_v2";
|
||||||
static const _shownKey = "shownNotifications";
|
static const _shownKey = "shownNotifications";
|
||||||
|
|
||||||
/// IDs of the notifications shown, by thread. Stored, since they're often
|
/// IDs of the notifications shown, by thread. Stored, since they're often
|
||||||
|
|
@ -333,8 +341,10 @@ class NotificationController
|
||||||
styleInformation: BigTextStyleInformation(body),
|
styleInformation: BigTextStyleInformation(body),
|
||||||
)
|
)
|
||||||
: .new(
|
: .new(
|
||||||
"messages",
|
_messagesChannel,
|
||||||
"Messages",
|
"Messages",
|
||||||
|
importance: .high,
|
||||||
|
priority: .high,
|
||||||
groupKey: _androidGroup,
|
groupKey: _androidGroup,
|
||||||
subText: subtitle,
|
subText: subtitle,
|
||||||
silent: !sound,
|
silent: !sound,
|
||||||
|
|
@ -386,8 +396,9 @@ class NotificationController
|
||||||
payload: _summaryPayload,
|
payload: _summaryPayload,
|
||||||
notificationDetails: const .new(
|
notificationDetails: const .new(
|
||||||
android: .new(
|
android: .new(
|
||||||
"messages",
|
_messagesChannel,
|
||||||
"Messages",
|
"Messages",
|
||||||
|
importance: .high,
|
||||||
groupKey: _androidGroup,
|
groupKey: _androidGroup,
|
||||||
setAsGroupSummary: true,
|
setAsGroupSummary: true,
|
||||||
groupAlertBehavior: .children,
|
groupAlertBehavior: .children,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue