refactor: Only initialize FlutterLocalNotificationsPlugin once

This commit is contained in:
krille-chan 2024-08-01 09:18:12 +02:00
commit d3a13705bd
No known key found for this signature in database
2 changed files with 309 additions and 296 deletions

View file

@ -71,7 +71,7 @@ class BackgroundPush {
BackgroundPush._(this.client) {
firebase?.setListeners(
onMessage: (message) => pushHelper(
onMessage: (message) => PushHelper.processNotification(
PushNotification.fromJson(
Map<String, dynamic>.from(message['data'] ?? message),
),
@ -393,7 +393,7 @@ class BackgroundPush {
);
// UP may strip the devices list
data['devices'] ??= [];
await pushHelper(
await PushHelper.processNotification(
PushNotification.fromJson(data),
client: client,
l10n: l10n,