|
|
@ -64,17 +64,12 @@ class PushUtils { |
|
|
|
|
|
|
|
|
|
|
|
if (notification.subject.delete ?? false) { |
|
|
|
if (notification.subject.delete ?? false) { |
|
|
|
await localNotificationsPlugin.cancel(_getNotificationID(instance, notification)); |
|
|
|
await localNotificationsPlugin.cancel(_getNotificationID(instance, notification)); |
|
|
|
return; |
|
|
|
} else if (notification.subject.deleteAll ?? false) { |
|
|
|
} |
|
|
|
|
|
|
|
if (notification.subject.deleteAll ?? false) { |
|
|
|
|
|
|
|
await localNotificationsPlugin.cancelAll(); |
|
|
|
await localNotificationsPlugin.cancelAll(); |
|
|
|
return; |
|
|
|
Global.onPushNotificationReceived?.call(instance); |
|
|
|
} |
|
|
|
} else if (notification.type == 'background') { |
|
|
|
if (notification.type == 'background') { |
|
|
|
|
|
|
|
debugPrint('Got unknown background notification ${json.encode(notification.toJson())}'); |
|
|
|
debugPrint('Got unknown background notification ${json.encode(notification.toJson())}'); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final localizations = await appLocalizationsFromSystem(); |
|
|
|
final localizations = await appLocalizationsFromSystem(); |
|
|
|
|
|
|
|
|
|
|
|
final platform = await getNeonPlatform(); |
|
|
|
final platform = await getNeonPlatform(); |
|
|
@ -113,7 +108,8 @@ class PushUtils { |
|
|
|
), |
|
|
|
), |
|
|
|
linux: LinuxNotificationDetails( |
|
|
|
linux: LinuxNotificationDetails( |
|
|
|
icon: AssetsLinuxIcon('assets/apps/${app.id}.svg'), |
|
|
|
icon: AssetsLinuxIcon('assets/apps/${app.id}.svg'), |
|
|
|
urgency: notification.type == 'voip' ? LinuxNotificationUrgency.critical : LinuxNotificationUrgency.normal, |
|
|
|
urgency: |
|
|
|
|
|
|
|
notification.type == 'voip' ? LinuxNotificationUrgency.critical : LinuxNotificationUrgency.normal, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
payload: json.encode( |
|
|
|
payload: json.encode( |
|
|
@ -125,6 +121,7 @@ class PushUtils { |
|
|
|
).toJson(), |
|
|
|
).toJson(), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Global.onPushNotificationReceived?.call(instance); |
|
|
|
Global.onPushNotificationReceived?.call(instance); |
|
|
|
} |
|
|
|
} |
|
|
|