Skip to content

Commit

Permalink
fix(core): set bundle id for notifications on macOS (#3839)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Apr 2, 2022
1 parent 9712ed1 commit f67ae6b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-mac-notification-appid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Set the application bundle identifier for the notifications on macOS.
8 changes: 8 additions & 0 deletions core/tauri/src/api/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions examples/api/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f67ae6b

Please sign in to comment.