#push-notifications #macos #notifications #integration #api-bindings

aloe-mac-notifications

A Rust library for managing macOS push notifications, providing interfaces for notification registration, delivery, and handling. This crate is a translation of the c++ juce module serving the same function.

1 unstable release

Uses new Rust 2024

new 0.1.2 Apr 3, 2025

#15 in #push-notifications

GPL-3.0 license

525KB
5K SLoC

Aloe Mac Notifications

aloe-mac-notifications is a robust Rust library designed for seamless integration of push notifications on macOS platforms. Leveraging Apple's native notification features, it allows developers to manage notifications with precision and efficiency.

Features

  • Registration: Supports device registration for remote notifications, properly handling successes and failures.
  • Local Notifications: Enables sending and managing local notifications with customizable attributes such as sounds, actions, and delivery times.
  • Notification Handling: Implements comprehensive interfaces for delivering and interacting with both remote and local notifications.
  • Notification Conversion: Facilitates conversion between Aloe notifications and macOS's NSUserNotification objects for compatibility and extensibility.

Example Usage

To use the aloe-mac-notifications crate in your Rust project:

use aloe_mac_notifications::{PushNotificationsDelegateInterface, PushNotificationImpl};

// Initialize and setup notifications
let mut notifications = PushNotificationImpl::new(&mut push_notifications);
notifications.request_permissions_with_settings(&settings);

// Send a local notification
notifications.send_local_notification(&push_notification);

Concepts and Background

In macOS, notifications are crucial for delivering timely information to users. This crate abstractly handles notifications by interacting with Objective-C classes using NSUserNotification, while managing notification settings and lifecycle.

Installation

Include this crate in your Cargo.toml:

[dependencies]
aloe-mac-notifications = "0.1.0"

Important Notes

  • This crate depends on macOS notifications, hence it is only suitable for macOS applications.
  • Ensure proper testing on various macOS versions, as behavior may vary.

This README.md was generated by an AI model. While potentially helpful, it might not be 100% accurate.

This crate is a translation of the JUCE module.

JUCE is a c++ software framework for developing high performance audio applications.

Usage falls under the GPLv3 as well as the JUCE commercial license.

See github.com/juce-framework/JUCE and the JUCE license page for details.

This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.

Dependencies

~15–27MB
~443K SLoC