Browse Source

neon: Set timestamp of push notification

pull/263/head
jld3103 2 years ago
parent
commit
37ab6c541a
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/neon/neon/lib/src/utils/push_utils.dart

2
packages/neon/neon/lib/src/utils/push_utils.dart

@ -99,6 +99,7 @@ class PushUtils {
} }
final title = notification?.subject ?? pushNotification.subject.subject; final title = notification?.subject ?? pushNotification.subject.subject;
final message = notification != null && notification.message != '' ? notification.message : null; final message = notification != null && notification.message != '' ? notification.message : null;
final when = notification != null ? DateTime.parse(notification.datetime) : null;
await localNotificationsPlugin.show( await localNotificationsPlugin.show(
_getNotificationID(instance, pushNotification), _getNotificationID(instance, pushNotification),
@ -111,6 +112,7 @@ class PushUtils {
subText: accounts.length > 1 && account != null ? account.client.humanReadableID : null, subText: accounts.length > 1 && account != null ? account.client.humanReadableID : null,
groupKey: 'app_$appID', groupKey: 'app_$appID',
icon: '@mipmap/ic_launcher', icon: '@mipmap/ic_launcher',
when: when?.millisecondsSinceEpoch,
color: themePrimaryColor, color: themePrimaryColor,
category: pushNotification.type == 'voip' ? AndroidNotificationCategory.call : null, category: pushNotification.type == 'voip' ? AndroidNotificationCategory.call : null,
importance: Importance.max, importance: Importance.max,

Loading…
Cancel
Save