Przeglądaj źródła

fix(core): set bundle id for notifications on macOS (#3839)

Lucas Fernandes Nogueira 3 lat temu
rodzic
commit
f67ae6bd60

+ 5 - 0
.changes/fix-mac-notification-appid.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Set the application bundle identifier for the notifications on macOS.

+ 8 - 0
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");

+ 2 - 2
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",