Skip to content

Commit

Permalink
refactor: Only initialize FlutterLocalNotificationsPlugin once
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Aug 1, 2024
1 parent e5bbb75 commit d3a1370
Show file tree
Hide file tree
Showing 2 changed files with 309 additions and 296 deletions.
4 changes: 2 additions & 2 deletions lib/utils/background_push.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand Down Expand Up @@ -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,
Expand Down
Loading

0 comments on commit d3a1370

Please sign in to comment.