A much more detailed notification

This commit is contained in:
2026-02-27 07:05:08 +08:00
parent 9cc99e612a
commit dab43a7f30
9 changed files with 178 additions and 41 deletions
+6 -6
View File
@@ -121,14 +121,14 @@ class NotificationsController {
actorId: actorId,
fields: {
'message_id': messageId,
if (ticketId != null) 'ticket_id': ticketId,
if (taskId != null) 'task_id': taskId,
...?(ticketId != null ? {'ticket_id': ticketId} : null),
...?(taskId != null ? {'task_id': taskId} : null),
},
pushTitle: 'New mention',
pushBody: 'You were mentioned in a message',
pushData: {
if (ticketId != null) 'ticket_id': ticketId,
if (taskId != null) 'task_id': taskId,
...?(ticketId != null ? {'ticket_id': ticketId} : null),
...?(taskId != null ? {'task_id': taskId} : null),
},
);
}
@@ -240,8 +240,8 @@ class NotificationsController {
return;
}
final bodyPayload = <String, dynamic>{
if (tokens != null) 'tokens': tokens,
if (userIds != null) 'user_ids': userIds,
'tokens': tokens ?? [],
'user_ids': userIds ?? [],
'title': title,
'body': body,
'data': data ?? {},