Struct fcm::NotificationBuilder
[−]
[src]
pub struct NotificationBuilder<'a> { /* fields omitted */ }
A builder to get a Notification
instance.
Examples
use fcm::NotificationBuilder; let mut builder = NotificationBuilder::new(); builder.body("3 runs to win in 1 ball"); let notification = builder.finalize();
Methods
impl<'a> NotificationBuilder<'a>
[src]
pub fn new() -> NotificationBuilder<'a>
[src]
Get a new NotificationBuilder
instance, with a title.
ⓘImportant traits for &'a mut Wpub fn title(&mut self, title: &'a str) -> &mut Self
[src]
ⓘImportant traits for &'a mut Wpub fn body(&mut self, body: &'a str) -> &mut Self
[src]
Set the body of the notification
ⓘImportant traits for &'a mut Wpub fn icon(&mut self, icon: &'a str) -> &mut Self
[src]
Set the notification icon.
ⓘImportant traits for &'a mut Wpub fn sound(&mut self, sound: &'a str) -> &mut Self
[src]
Set the sound to be played
ⓘImportant traits for &'a mut Wpub fn badge(&mut self, badge: &'a str) -> &mut Self
[src]
Set the badge for iOS notifications
ⓘImportant traits for &'a mut Wpub fn tag(&mut self, tag: &'a str) -> &mut Self
[src]
Tagging a notification allows you to replace existing notifications with the same tag with this new notification
ⓘImportant traits for &'a mut Wpub fn color(&mut self, color: &'a str) -> &mut Self
[src]
The color of the icon, in #rrggbb format
ⓘImportant traits for &'a mut Wpub fn click_action(&mut self, click_action: &'a str) -> &mut Self
[src]
What happens when the user clicks on the notification. Refer to https://developers.google.com/cloud-messaging/http-server-ref#table2 for details.
ⓘImportant traits for &'a mut Wpub fn body_loc_key(&mut self, body_loc_key: &'a str) -> &mut Self
[src]
Set the body key string for localization
ⓘImportant traits for &'a mut Wpub fn body_loc_args<S>(&mut self, body_loc_args: &'a [S]) -> &mut Self where
S: Into<Cow<'a, str>> + AsRef<str>,
[src]
S: Into<Cow<'a, str>> + AsRef<str>,
String value to replace format specifiers in the body string.
ⓘImportant traits for &'a mut Wpub fn title_loc_key(&mut self, title_loc_key: &'a str) -> &mut Self
[src]
Set the title key string for localization
ⓘImportant traits for &'a mut Wpub fn title_loc_args<S>(&mut self, title_loc_args: &'a [S]) -> &mut Self where
S: Into<Cow<'a, str>> + AsRef<str>,
[src]
S: Into<Cow<'a, str>> + AsRef<str>,
String value to replace format specifiers in the title string.
pub fn finalize(self) -> Notification<'a>
[src]
Complete the build and get a Notification
instance