flutter_local_notifications updates

Ios->Darwin, etc.
This commit is contained in:
sneurlax 2024-04-04 18:18:24 -05:00
parent a13b1b6da3
commit f26e6e8b01

View file

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