Browse Source

neon: Always call push notification received handler

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

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

@ -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);
}

Loading…
Cancel
Save