| Crates.io | armature-push |
| lib.rs | armature-push |
| version | 0.1.1 |
| created_at | 2025-12-27 00:14:01.3926+00 |
| updated_at | 2025-12-30 22:24:41.971328+00 |
| description | Push notifications for Armature - Web Push, FCM, and APNS |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006468 |
| size | 129,283 |
Push notifications for the Armature framework.
[dependencies]
armature-push = "0.1"
use armature_push::{PushService, Notification};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let push = PushService::new()
.fcm("server-key")
.apns("key.p8", "team-id", "key-id")
.web_push("vapid-private-key");
// Send notification
push.send(Notification {
title: "Hello!",
body: "You have a new message",
data: Some(json!({"message_id": 123})),
}, &device_token).await?;
Ok(())
}
// Register subscription
let subscription = WebPushSubscription {
endpoint: "https://...",
keys: PushKeys { p256dh: "...", auth: "..." },
};
push.web_push().send(&subscription, notification).await?;
push.fcm().send(&fcm_token, notification).await?;
push.apns().send(&device_token, notification).await?;
MIT OR Apache-2.0