19 releases

0.6.2 Sep 11, 2024
0.6.1 Aug 12, 2023
0.5.9 Aug 11, 2023
0.5.8 Jul 23, 2023
0.1.1 Mar 12, 2017

#33 in macOS and iOS APIs

Download history 11233/week @ 2024-08-02 12384/week @ 2024-08-09 10324/week @ 2024-08-16 10675/week @ 2024-08-23 11431/week @ 2024-08-30 9580/week @ 2024-09-06 10267/week @ 2024-09-13 9544/week @ 2024-09-20 12961/week @ 2024-09-27 11861/week @ 2024-10-04 13070/week @ 2024-10-11 12535/week @ 2024-10-18 16074/week @ 2024-10-25 18372/week @ 2024-11-01 14927/week @ 2024-11-08 19100/week @ 2024-11-15

70,312 downloads per month
Used in 208 crates (5 directly)

MIT license

34KB
528 lines

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.

Dependencies

~0.9–1.7MB
~30K SLoC