Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No notification on macOS #31

Open
RetroAndDev opened this issue Aug 10, 2024 · 2 comments
Open

No notification on macOS #31

RetroAndDev opened this issue Aug 10, 2024 · 2 comments

Comments

@RetroAndDev
Copy link

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 ?

@RetroAndDev
Copy link
Author

Any idea ?
I really need this to work for my project

@KoVaL05
Copy link

KoVaL05 commented Sep 30, 2024

Same issue here, any solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants