Struct expo_server_sdk::PushNotifier [−][src]
pub struct PushNotifier { pub url: String, pub pushes_per_request: usize, pub gzip_policy: GzipPolicy, // some fields omitted }
The PushNotifier
takes one or more PushMessage
to send to the push notification server
Example:
extern crate expo_server_sdk; use expo_server_sdk::*; use std::str::FromStr; let token = PushToken::from_str("ExpoPushToken[my-token]").unwrap(); let mut msg = PushMessage::new(token).body("test notification"); let push_notifier = PushNotifier::new().gzip_policy(GzipPolicy::Always); let result = push_notifier.send_push_notification(&msg);
Fields
url: String
pushes_per_request: usize
gzip_policy: GzipPolicy
Methods
impl PushNotifier
[src]
impl PushNotifier
pub fn new() -> PushNotifier
[src]
pub fn new() -> PushNotifier
pub fn url(
self,
url: impl Into<String>
) -> Self
[src]
pub fn url(
self,
url: impl Into<String>
) -> Self
Specify the URL to the push notification server Default is the Expo push notification server.
pub fn with_pushes_per_request(self, pushes_per_request: usize) -> Self
[src]
pub fn with_pushes_per_request(self, pushes_per_request: usize) -> Self
Specify the number of push notifications to group together into one request Default is 100.
pub fn gzip_policy(self, gzip_policy: GzipPolicy) -> Self
[src]
pub fn gzip_policy(self, gzip_policy: GzipPolicy) -> Self
Specify when gzip'ping the request body occurrs Default policy is to gzip when the request body exceeds 1024 bytes.
pub fn send_push_notifications(
&self,
messages: &[PushMessage]
) -> Result<Vec<PushReceipt<Value>>, Error>
[src]
pub fn send_push_notifications(
&self,
messages: &[PushMessage]
) -> Result<Vec<PushReceipt<Value>>, Error>
Sends a vector of PushMessage
to the push notification server.
pub fn send_push_notification(
&self,
message: &PushMessage
) -> Result<PushReceipt<Value>, Error>
[src]
pub fn send_push_notification(
&self,
message: &PushMessage
) -> Result<PushReceipt<Value>, Error>
Sends a single PushMessage
to the push notification server.
Auto Trait Implementations
impl Send for PushNotifier
impl Send for PushNotifier
impl Sync for PushNotifier
impl Sync for PushNotifier