-
Notifications
You must be signed in to change notification settings - Fork 311
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
[bug] Notifications not working in MacOS #2143
Comments
I also tried cloning the tauri api example and tried sending the test notification but doesn't work. I'm not sure but maybe it has something to do with the fact that I cannot find the folder (named by identifier) in I'm not getting any errors. It just doesn't do anything. |
The |
Oh ok. Do you have any idea what might be the problem? Using either the Notification Web API or Tauri's Notification API, the permission is always |
Nope, the permissions/notifications on macos are generally quite wonky (in a tauri context), and for some reason it seems to be gotten worse in recent tauri versions. |
I see. I hope this issue also gets handled asap amidst your progressions with tauri. Thanks. |
This sounds like the most relevant upstream issue h4llow3En/mac-notification-sys#33 |
@Kakamotobi @FabianLars Locate the source code and find possible reasons is: if we have (attach the successful pictrue like this...) |
Oh! Nice finding! Can you check in the system permissions settings if you disabled Notifications for the Terminal application? |
Sure. I'll try it right away |
@FabianLars |
@Moon1102 Nice. Thanks for letting me know. I just checked and yes, the notifications are working as expected in production. |
Notification doesn't show up for me on Mac recently even in production mode. Did anyone have the same problem? |
Yeah, in production mode it popped up with the permission window. But won't displayed any actual notifications. |
in production, the notifications are working. however, in dev mode, they are not. quite the bummer. |
In my case, notifications work in dev mode (though I haven't been able to figure out how to get sounds working) and they show up as coming from Terminal. With prod builds, they seemingly didn't work at all but then I noticed that some of the notifications showed way later when a notification from another app arrived. This made me check the notification center and there I saw all of the notifications I sent. Meaning, they didn't show up on the screen, they went directly into the notification center. Without any DND/focus mode enabled. I then went into the notification settings for the app and changed the style from Banners to Alerts, and that did make the notifications appear on the screen. They need to be manually dismissed, but at least they show up. |
I recently came across this issue on MacOS. It seems when working in dev mode, I'm unable to receive notifications, but once I've built a release or test in production with the proper permissions set, it all works as expected. A quick workaround for this is to run the application within a browser, which does limit some functionality. This is a good way to test notifications in a dev environment without needing to build, but obviously a bug nonetheless. I assume this is because the notification channel is using the browser's permissions instead of the application's direct permissions, which are correctly configured in this scenario. Not sure how helpful this is, but I wanted to include it here to help with remediation in the future. |
Has there been any progress on this? Or are we stuck only testing notifications in prod on mac? |
For those having issues in development. First of all, please make sure that the Terminal has Notification permissions in the OS settings If that doesn't help, please try the api-example from this repo https://github.com/tauri-apps/plugins-workspace/ so we can check if it's project specific (this repo works on my machine) Edit: Also for testing, please run tauri dev in the macos native terminal and not some third party terminal. |
Describe the bug
I'm using Tauri with Svelte on a MacOS. But I'm having trouble with the
notification
module.All Tauri APIs are allowlisted in
tauri.conf.json
.The code below runs and prints
permissionGranted
astrue
but thesendNotification
s seem to have no effect.I also tried using the Notifications API in the Tauri console itself but nothing happens and the created Notification object has no properties.
Reproduction
npm create tauri-app
and initiate with Svelte.cd
into directory andnpm install
.npm run tauri dev
.Expected behavior
Notification sent to MacOS.
Platform and versions
Environment
› OS: Mac OS 12.4.0 X64
› Node.js: 17.2.0
› npm: 8.13.2
› pnpm: 6.11.0
› yarn: 1.22.15
› rustup: 1.25.1
› rustc: 1.62.0
› cargo: 1.62.0
› Rust toolchain: stable-x86_64-apple-darwin
Packages
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,
App
› build-type: bundle
› CSP: unset
› distDir: ../public
› devPath: http://localhost:8080/
› framework: Svelte
› bundler: Rollup
Stack trace
No response
Additional context
tauri.conf.json
package.json
The text was updated successfully, but these errors were encountered: