-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Hi !
I got working the package with macOS but now, for an obscure reason, my notifications won't appear
I'm on a M1 MacBook Pro With macOS Sonoma 14.5
Here is my code :
print("App is not focused. Showing desktop notification");
// Display a notification
LocalNotification notification = LocalNotification(
title: notificationData.title,
body: notificationData.content,
);
await notification.show();
print("Sent notification");
My notificationData
object is fetched from my API (sent by WebSocket). Even with hard-coded strings, it still not works.
I Initialize the Local Notifier from main()
in lib/main.dart
with :
// Initialize the Notification Manager
if(Platform.isWindows){
await localNotifier.setup(
appName: 'StudySuite',
// The parameter shortcutPolicy only works on Windows
shortcutPolicy: ShortcutPolicy.requireCreate,
);
}
else{
await localNotifier.setup(
appName: 'StudySuite',
);
(I put a Windows condition for the shortcutPolicy
, it is needed ? Made that when my app doesn't send notifications. Before It was the same for macOS and Windows)
Any idea to get my notification working ?
Metadata
Metadata
Assignees
Labels
No labels