| Crates.io | ios_local_notification |
| lib.rs | ios_local_notification |
| version | 1.0.1 |
| created_at | 2025-09-05 14:37:01.041099+00 |
| updated_at | 2025-09-05 14:59:26.077774+00 |
| description | Send local notifications on iOS. |
| homepage | https://github.com/DevYatsu/ios_local_notification |
| repository | https://github.com/DevYatsu/ios_local_notification |
| max_upload_size | |
| id | 1825646 |
| size | 22,897 |
Send local notifications on iOS directly from Rust, powered by swift-rs.
⚠️ Platform support: This crate works only on iOS.
Android or other platforms are not supported.
NOTE: notifications do not work in the IOS Simulator
cargo add ios_local_notification
use ios_local_notification as notif;
fn main() {
// Request permission with default options (all perms)
notif::request_permission_default();
// Or request custom permissions
notif::request_permission(
notif::permission::ALERT | notif::permission::SOUND,
);
// Schedule a notification after 5 seconds
notif::schedule("welcome", "Hello!", "This is your first notification 🚀", 5);
// Schedule a repeating notification
notif::schedule_repeat("ping", "Reminder", "This repeats every 10s", 10);
// Schedule with an image attachment
notif::schedule_image("img1", "Picture!", "With an image", "example.png", 5);
// Query notifications
let pending = notif::pending_notifications();
let delivered = notif::delivered_notifications();
println!("Pending: {:?}", pending);
println!("Delivered: {:?}", delivered);
// Remove a specific notification
notif::remove_by_id("welcome");
// Clear all notifications
notif::clear_all_pending();
notif::clear_all_delivered();
}
You can request granular permissions using bitflags from permission:
use ios_local_notification::permission;
notif::request_permission(permission::ALERT | permission::SOUND);
Available flags:
👉 Read the full API docs on docs.rs