chore: Follow up notification actions
This commit is contained in:
parent
40bd7eed91
commit
a88849c2db
3 changed files with 103 additions and 8 deletions
|
|
@ -315,11 +315,30 @@ Future<void> _tryPushHelper(
|
|||
title,
|
||||
body,
|
||||
platformChannelSpecifics,
|
||||
payload: event.roomId,
|
||||
payload:
|
||||
FluffyChatPushPayload(client.clientName, event.room.id, event.eventId)
|
||||
.toString(),
|
||||
);
|
||||
Logs().v('Push helper has been completed!');
|
||||
}
|
||||
|
||||
class FluffyChatPushPayload {
|
||||
final String? clientName, roomId, eventId;
|
||||
|
||||
FluffyChatPushPayload(this.clientName, this.roomId, this.eventId);
|
||||
|
||||
factory FluffyChatPushPayload.fromString(String payload) {
|
||||
final parts = payload.split('|');
|
||||
if (parts.length != 3) {
|
||||
return FluffyChatPushPayload(null, null, null);
|
||||
}
|
||||
return FluffyChatPushPayload(parts[0], parts[1], parts[2]);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => '$clientName|$roomId|$eventId';
|
||||
}
|
||||
|
||||
/// Creates a shortcut for Android platform but does not block displaying the
|
||||
/// notification. This is optional but provides a nicer view of the
|
||||
/// notification popup.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue