|
|
|
@ -64,17 +64,12 @@ class PushUtils {
|
|
|
|
|
|
|
|
|
|
if (notification.subject.delete ?? false) { |
|
|
|
|
await localNotificationsPlugin.cancel(_getNotificationID(instance, notification)); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (notification.subject.deleteAll ?? false) { |
|
|
|
|
} else if (notification.subject.deleteAll ?? false) { |
|
|
|
|
await localNotificationsPlugin.cancelAll(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (notification.type == 'background') { |
|
|
|
|
Global.onPushNotificationReceived?.call(instance); |
|
|
|
|
} else if (notification.type == 'background') { |
|
|
|
|
debugPrint('Got unknown background notification ${json.encode(notification.toJson())}'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
final localizations = await appLocalizationsFromSystem(); |
|
|
|
|
|
|
|
|
|
final platform = await getNeonPlatform(); |
|
|
|
@ -113,7 +108,8 @@ class PushUtils {
|
|
|
|
|
), |
|
|
|
|
linux: LinuxNotificationDetails( |
|
|
|
|
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( |
|
|
|
@ -125,6 +121,7 @@ class PushUtils {
|
|
|
|
|
).toJson(), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Global.onPushNotificationReceived?.call(instance); |
|
|
|
|
} |
|
|
|
|