mac-notification-sys

Crates.iomac-notification-sys
lib.rsmac-notification-sys
version0.6.2
sourcesrc
created_at2017-03-11 16:15:00.274701
updated_at2024-09-11 21:51:34.480104
descriptionThin wrapper around macOS Notifications.
homepagehttps://github.com/h4llow3En/mac-notification-sys
repositoryhttps://github.com/h4llow3En/mac-notification-sys
max_upload_size
id8933
size46,160
Hendrik Sollich (hoodie)

documentation

https://h4llow3en.github.io/mac-notification-sys/mac_notification_sys/

README

mac-notification-sys

platform version license contributors

build downloads documentation

A simple wrapper to deliver or schedule macOS Notifications in Rust.

Usage

#Cargo.toml
[dependencies]
mac-notification-sys = "0.6"

Documentation

The documentation can be found here

Example

use mac_notification_sys::*;

fn main() {
    let bundle = get_bundle_identifier_or_default("firefox");
    set_application(&bundle).unwrap();

    send_notification(
        "Danger",
        Some("Will Robinson"),
        "Run away as fast as you can",
        None,
    )
    .unwrap();

    send_notification(
        "NOW",
        None,
        "Without subtitle",
        Some(Notification::new().sound("Blow")),
    )
    .unwrap();
}

TODO

  • Add timeout option so notifications can be auto-closed
  • Allow NSDictionary to hold various types (perhaps with a union?)
  • Switch to UserNotification if possible

Contributors

Thanks goes to these wonderful people:

Any help in form of descriptive and friendly issues or comprehensive pull requests are welcome!

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in mac-notification-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Conventions

The Changelog of this library is generated from its commit log, there any commit message must conform with https://www.conventionalcommits.org/en/v1.0.0/. For simplicity you could make your commits with convco.

Commit count: 140

cargo fmt