| Crates.io | pushinator |
| lib.rs | pushinator |
| version | 0.1.3 |
| created_at | 2025-01-06 13:05:43.58335+00 |
| updated_at | 2025-01-27 20:24:28.791102+00 |
| description | 🔔 🦀 A Rust crate for sending push notifications to your devices |
| homepage | https://pushinator.com |
| repository | https://github.com/appricos/pushinator-rust |
| max_upload_size | |
| id | 1505564 |
| size | 49,261 |
A Rust library that enables developers to send push notifications seamlessly through the Pushinator API, supporting both synchronous and asynchronous operations.
Add this to your Cargo.toml:
[dependencies]
pushinator = "0.1.2"
Creating a client requires you to have a valid Pushinator API token:
use pushinator::PushinatorClient;
fn main() {
let pushinator_client = PushinatorClient::new("PUSHINATOR_API_TOKEN".to_string());
}
fn main() {
let pushinator_client = PushinatorClient::new("PUSHINATOR_API_TOKEN".to_string());
match pushinator_client.send_notification_sync("PUSHINATOR_CHANNEL_ID".to_string(), "Pushinator from Rust!") {
Ok(_) => println!("Notification sent successfully!"),
Err(err) => eprintln!("Error sending notification: {}", err),
}
}
#[tokio::main]
async fn main() {
let pushinator_client = PushinatorClient::new("PUSHINATOR_API_TOKEN".to_string());
match pushinator_client.send_notification("PUSHINATOR_CHANNEL_ID".to_string(), "Pushinator from Rust!").await {
Ok(_) => println!("Notification sent successfully!"),
Err(err) => eprintln!("Error sending notification: {}", err),
}
}