refactor: Only initialize FlutterLocalNotificationsPlugin once
This commit is contained in:
parent
e5bbb755d9
commit
d3a13705bd
2 changed files with 309 additions and 296 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue