armature-push

Crates.ioarmature-push
lib.rsarmature-push
version0.1.1
created_at2025-12-27 00:14:01.3926+00
updated_at2025-12-30 22:24:41.971328+00
descriptionPush notifications for Armature - Web Push, FCM, and APNS
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006468
size129,283
Joseph R. Quinn (quinnjr)

documentation

README

armature-push

Push notifications for the Armature framework.

Features

  • Web Push - Browser push notifications
  • FCM - Firebase Cloud Messaging
  • APNS - Apple Push Notification Service
  • Multi-Platform - Send to all platforms at once
  • Topics - Subscribe to notification topics

Installation

[dependencies]
armature-push = "0.1"

Quick Start

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(())
}

Web Push

// Register subscription
let subscription = WebPushSubscription {
    endpoint: "https://...",
    keys: PushKeys { p256dh: "...", auth: "..." },
};

push.web_push().send(&subscription, notification).await?;

FCM

push.fcm().send(&fcm_token, notification).await?;

APNS

push.apns().send(&device_token, notification).await?;

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt