diff --git a/lib/services/notifications_api.dart b/lib/services/notifications_api.dart index 3ef97462a..fa2f5f545 100644 --- a/lib/services/notifications_api.dart +++ b/lib/services/notifications_api.dart @@ -1,4 +1,4 @@ -/* +/* * This file is part of Stack Wallet. * * Copyright (c) 2023 Cypher Stack @@ -25,17 +25,17 @@ class NotificationApi { // importance: Importance.max, priority: Priority.high, ticker: 'ticker'), - iOS: IOSNotificationDetails(), - macOS: MacOSNotificationDetails(), + iOS: DarwinNotificationDetails(), + macOS: DarwinNotificationDetails(), ); } static Future init({bool initScheduled = false}) async { const android = AndroidInitializationSettings('app_icon_alpha'); - const iOS = IOSInitializationSettings(); + const iOS = DarwinInitializationSettings(); const linux = LinuxInitializationSettings( defaultActionName: "temporary_stack_wallet"); - const macOS = MacOSInitializationSettings(); + const macOS = DarwinInitializationSettings(); const settings = InitializationSettings( android: android, iOS: iOS, @@ -44,8 +44,11 @@ class NotificationApi { ); await _notifications.initialize( settings, - onSelectNotification: (payload) async { - onNotifications.add(payload); + onDidReceiveNotificationResponse: (payload) async { + onNotifications.add(payload.payload); + }, + onDidReceiveBackgroundNotificationResponse: (payload) async { + onNotifications.add(payload.payload); }, ); }