fcm-notification

Crates.iofcm-notification
lib.rsfcm-notification
version0.1.2
created_at2025-01-30 09:06:39.879553+00
updated_at2025-01-30 10:35:21.416236+00
descriptionThis repository provides a Rust implementation for sending push notifications using Firebase Cloud Messaging (FCM)
homepage
repositoryhttps://github.com/therasuldev/fcm-notification
max_upload_size
id1536203
size10,087
Rasul Ramixanov (therasuldev)

documentation

README

fcm_notification

A Rust library for sending Firebase Cloud Messaging (FCM) notifications.

Installation

Add the following to your Cargo.toml:

[dependencies]
fcm-notification = "0.1.2"

Usage

use fcm_notification::{FcmNotification, NotificationPayload};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let fcm = FcmNotification::new("service_account.json")?;
    let notification = NotificationPayload {
        token: "device-token-here",
        title: "New Like",
        body: "Someone liked your post!",
        data: None,
    };
    fcm.send_notification(&notification).await?;
    Ok(())
}

License

This project is licensed under the MIT License.

Commit count: 5

cargo fmt