| Crates.io | user-notify |
| lib.rs | user-notify |
| version | 0.4.2 |
| created_at | 2026-01-23 17:29:20.222307+00 |
| updated_at | 2026-01-23 17:58:55.356575+00 |
| description | Show desktop notifications to end users on linux, macOS and windows. |
| homepage | |
| repository | https://github.com/Simon-Laux/user-notify |
| max_upload_size | |
| id | 2065120 |
| size | 174,575 |
user-notifySimple library to implement user facing notifications in end-user applications on macOS, Linux and Windows.
The name user-notify is inspired by how the system API is called in the Apple ecosystem (“User Notifications”).
You can send notifications to your users using this crate. Goal of this crate is to provide an API that just works and offers enough of the platform specific API to be useful for creating full apps like instant messengers.
Currently there is no built-in support for timeouts on notifications (see #4).
If you this crate is not for you, then you may like https://github.com/hoodie/notify-rust, which is an established crate, but has less feature support on macOS.
org.freedesktop.Notifications dbus protocol. (most modern desktop environments do)TODO : for now look in these places:
examples/test.rsThis library was initially created as replacement for tauri's notification APIs, because they did not implement all notification features that we needed for our project of porting the Delta Chat instant messenger from electron to tauri (Basic features like reacting to clicks on notifications were missing in the rust api).
Legend:
#issue-number — tracking issue for implementing it| What | API | macOS | Linux | Windows |
|---|---|---|---|---|
| Primary description | Notification.title |
✅ | ✅ | ✅ |
| Main content | Notification.body |
✅ | ✅ | ✅ |
| secondary description | Notification.subtitle |
✅ | ❌ | ✅ |
| Image Attachment | Notification.set_image |
✅ | ✅ | ✅ |
| Override app icon | Notification.set_icon |
❌ | ✅ | ✅ |
| Group notifications by thread |
Notification.set_thread_id |
✅ | ❌ | #3 |
| Set category/template with actions | Notification.set_category_id |
✅ | ✅ | ✅ |
| Set notification data | Notification.set_user_info |
✅ | ✅🏃 | ✅ |
| Persistent notifications across sessions (keeping their data even when you restart the app / handle notifications from previous sessions) |
- | ✅ | ❌ | ✅ |
| Get permission state | NotificationManager .get_notification_permission_state |
✅ | ❌ | NO |
| Ask for permission | NotificationManager .first_time_ask_for_notification_permission |
✅ | ❌ | ❌ |
| Remove all notifications | NotificationManager .remove_all_delivered_notifications |
✅ | ✅🏃 | ✅ |
| Remove notifications by id | NotificationManager .remove_delivered_notifications |
✅ | ✅🏃 | ✅ |
| Get still active notifications | NotificationManager .get_active_notifications |
✅ | ✅🏃 | ✅🏃 |
| Action: Button | NotificationCategoryAction::Action |
✅ | #1 | #2 |
| Action: reply input field | NotificationCategoryAction::TextInputAction |
✅ | ❌ | #2 |
Platform specific API:
| What | API | macOS | Linux | Windows |
|---|---|---|---|---|
| Set App icon to be round | Notification.set_icon_round_crop |
❌ | ❌ | ✅ |
| Set xdg notification Category | Notification.set_xdg_category |
❌ | ✅ | ❌ |
| Override app name | Notification.set_xdg_app_name |
❌ | ✅ | ❌ |
RUST_LOG=debug cargo run --example test
On macOS you need a signed app package, otherwise notifications don't work. So may only work fully in released/packaged versions when you use tauri, you can use the "mock" implementation in debug mode which just logs to the console.
You can build and package the example (examples/test.rs) for macOS with this helper script:
security find-identity -v -p codesigning
# replace the zeros with the signing key you want to use
APPLE_SIGNING_IDENTITY=00000000000000000000000000000000000000 ./test_example_macos.sh
TODO: instructions for windows (I don't remember if it also needed custom steps)
These links can be useful for reference when contributing to this plugin.
Contributions are welcome. Just be nice to everyone, if you are unsure what being nice and fair means, then refer to https://delta.chat/en/community-standards.