pub struct FcmSettings {
pub min_ttl: u64,
pub server_credentials: String,
pub max_data: usize,
pub base_url: Url,
pub timeout: usize,
pub max_ttl: i64,
}Expand description
Settings for FcmRouter
Fields§
§min_ttl: u64The minimum TTL to use for FCM notifications
server_credentials: StringA JSON dict of FcmCredentials. This must be a String because
environment variables cannot encode a HashMap<String, FcmCredential>
This contains both GCM and FCM credentials.
FCM (the more modern credential set) is specified as
{"_project_id_":{"project_id": "_project_id_", "credential": "_key_"}, ...}For FCM, credential keys can be either a serialized JSON string, or the
path to the JSON key file.
GCM follows the same pattern, where
_project_id_ == senderID and _key_ == credential
e.g. “bar-project” is via FCM, with a serialized JSON key,
e.g. “gorp-project” is via FCM, with a key path,
and a GCM project with SenderID of “f00” specifies the server key as credential
{"bar-project":{"project_id": "bar-project-1234", "credential": "{\"type\": ...}"},
"gorp-project":{"project_id": "gorp-project-abcd", "credential": "keys/gorp-project.json"},
"f00": {"project_id": "f00", "credential": "abcd0123457"},
...
}max_data: usizeThe max size of notification data in bytes
base_url: UrlThe base URL to use for FCM requests
timeout: usizeThe number of seconds to wait for FCM requests to complete
max_ttl: i64The max TTL for a FCM notification.
Implementations§
Source§impl FcmSettings
impl FcmSettings
Sourcepub fn credentials(&self) -> Result<HashMap<String, FcmServerCredential>>
pub fn credentials(&self) -> Result<HashMap<String, FcmServerCredential>>
Read the credentials from the provided JSON
Trait Implementations§
Source§impl Clone for FcmSettings
impl Clone for FcmSettings
Source§fn clone(&self) -> FcmSettings
fn clone(&self) -> FcmSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more