From f67ae6bd6052d5bc30305ecaa3b83d071da3cfca Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 1 Apr 2022 19:35:29 -0700 Subject: [PATCH] fix(core): set bundle id for notifications on macOS (#3839) --- .changes/fix-mac-notification-appid.md | 5 +++++ core/tauri/src/api/notification.rs | 8 ++++++++ examples/api/src-tauri/Cargo.lock | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .changes/fix-mac-notification-appid.md diff --git a/.changes/fix-mac-notification-appid.md b/.changes/fix-mac-notification-appid.md new file mode 100644 index 000000000..fd05f4960 --- /dev/null +++ b/.changes/fix-mac-notification-appid.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Set the application bundle identifier for the notifications on macOS. diff --git a/core/tauri/src/api/notification.rs b/core/tauri/src/api/notification.rs index c658f17bb..982283f21 100644 --- a/core/tauri/src/api/notification.rs +++ b/core/tauri/src/api/notification.rs @@ -96,6 +96,14 @@ impl Notification { notification.app_id(&self.identifier); } } + #[cfg(target_os = "macos")] + { + let _ = notify_rust::set_application(if cfg!(feature = "custom-protocol") { + &self.identifier + } else { + "com.apple.Terminal" + }); + } crate::async_runtime::spawn(async move { notification.show().expect("failed to show notification"); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index c0498ada4..e7d9adc7f 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -3171,7 +3171,7 @@ dependencies = [ [[package]] name = "tauri" -version = "1.0.0-rc.5" +version = "1.0.0-rc.6" dependencies = [ "anyhow", "attohttpc", @@ -3289,7 +3289,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.3.4" +version = "0.3.5" dependencies = [ "gtk", "rand 0.8.5",