Rust

Push adapters: Apns (Apple, HTTP/2 with an ES256 token) and Fcm (Firebase, with an RS256 service-account assertion exchanged for an OAuth2 access token).

Contents

use utopia_messaging::push::Apns;
Rust
pub struct Apns

Apple Push Notification service, one HTTP/2 request per device token, authenticated with an ES256 token of the team's key.

use utopia_messaging::push::Fcm;
Rust
pub struct Fcm

Firebase Cloud Messaging (HTTP v1): the service account's RS256 assertion is exchanged for an access token, then one request per device token.

use utopia_messaging::push::error;
Rust
pub fn error(result: &Reply) -> String

A failed send's reason: an expired token, FCM's message, or the transport failure with the status and cURL error number.

Rust
pub const EXPIRED_MESSAGE: &str = "Expired device token"

The error of a token the provider no longer knows.

Rust
pub const GOOGLE_TOKEN_URL: &str = "https://www.googleapis.com/oauth2/v4/token"

Where the assertion is exchanged for an access token.

Rust
pub const TYPE: &str = "push"

The kind of every push adapter.