| 1 | use notify_rust::Notification; |
| 2 | |
| 3 | fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 4 | #[cfg(target_os = "macos")] |
| 5 | cfg_if::cfg_if! { |
| 6 | if #[cfg(feature = "preview-macos-un")] { |
| 7 | notify_rust::check_bundle().unwrap(); |
| 8 | notify_rust::request_auth_blocking().unwrap(); |
| 9 | } else { |
| 10 | let bundle_id = notify_rust::get_bundle_identifier_or_default("safari"); |
| 11 | notify_rust::set_application(&bundle_id).unwrap(); |
| 12 | } |
| 13 | } |
| 14 | Notification::new() |
| 15 | .summary(".image_path()") |
| 16 | .body("Trying to open an image") |
| 17 | .image_path("./examples/octodex.jpg") |
| 18 | .show()?; |
| 19 | |
| 20 | Ok(()) |
| 21 | } |