macos specific notifications fix

This commit is contained in:
julian-CStack 2023-07-17 10:36:45 -06:00
parent bc85b97f5f
commit 27c2f34a33
2 changed files with 10 additions and 4 deletions

View file

@ -26,6 +26,7 @@ class NotificationApi {
priority: Priority.high,
ticker: 'ticker'),
iOS: IOSNotificationDetails(),
macOS: MacOSNotificationDetails(),
);
}
@ -34,8 +35,13 @@ class NotificationApi {
const iOS = IOSInitializationSettings();
const linux = LinuxInitializationSettings(
defaultActionName: "temporary_stack_wallet");
const settings =
InitializationSettings(android: android, iOS: iOS, linux: linux);
const macOS = MacOSInitializationSettings();
const settings = InitializationSettings(
android: android,
iOS: iOS,
linux: linux,
macOS: macOS,
);
await _notifications.initialize(
settings,
onSelectNotification: (payload) async {

View file

@ -27,8 +27,8 @@ abstract class StackFileSystem {
} else if (Platform.isWindows) {
appDirectory = await getApplicationSupportDirectory();
} else if (Platform.isMacOS) {
// currently run in ipad mode??
throw Exception("Unsupported platform");
appDirectory = await getLibraryDirectory();
appDirectory = Directory("${appDirectory.path}/stackwallet");
} else if (Platform.isIOS) {
// todo: check if we need different behaviour here
if (Util.isDesktop) {