expo_push_notification_client 0.2.4

Expo Push Notification Client for Rust
Documentation
expo_push_notification_client-0.2.4 has been yanked.

Expo Push Notification Client for Rust

This is an official Expo Push Notification Client for Rust.

ci crates.io docs.rs license

Client (ReactNative with Expo)

You need to get Expo Push Token from Expo SDK and send it to Expo server first. See Expo Push Notification Docs for more details.

Server (Rust)

install expo_push_notification_client crate

cargo add expo_push_notification_client

how to use

use expo_push_notification_client::{Expo, ExpoClientOptions, ExpoPushMessage, GetPushNotificationReceiptsRequest};

let expo = Expo::new(ExpoClientOptions {
    access_token: Some(access_token),
});

let expo_push_tokens = ["ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"];
let expo_push_message = ExpoPushMessage::builder(expo_push_tokens).build()?;
expo.send_push_notifications(expo_push_message).await;

let expo_push_ids = GetPushNotificationReceiptsRequest::new(vec!["xxxxx".to_string(), "xxxxx".to_string()]);
expo.get_push_notification_receipts(expo_push_ids).await;