feat: Allow attaching arbitrary data to the notification

This commit is contained in:
2023-07-29 15:32:33 +02:00
parent 6da35cd0ba
commit c7ee2b6c6e
6 changed files with 84 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ class MyAppState extends State<MyApp> {
);
MoxplatformPlugin.notifications.getEventStream().listen((event) {
print('NotificationEvent(type: ${event.type}, jid: ${event.jid}, payload: ${event.payload})');
print('NotificationEvent(type: ${event.type}, jid: ${event.jid}, payload: ${event.payload}, extras: ${event.extra})');
});
}
@@ -191,6 +191,11 @@ class MyHomePage extends StatelessWidget {
messages: messages,
channelId: channelId,
jid: 'testjid',
extra: {
'jid': 'testjid',
'avatarPath': 'lol',
'rio': 'cute',
},
),
);
},