Struct fcm::NotificationBuilder
[−]
[src]
pub struct NotificationBuilder { /* 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 NotificationBuilder
[src]
pub fn new() -> NotificationBuilder
[src]
Get a new NotificationBuilder
instance, with a title.
pub fn title<S>(&mut self, title: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
pub fn body<S>(&mut self, body: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Set the body of the notification
pub fn icon<S>(&mut self, icon: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Set the notification icon.
pub fn sound<S>(&mut self, sound: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Set the sound to be played
pub fn badge<S>(&mut self, badge: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Set the badge for iOS notifications
pub fn tag<S>(&mut self, tag: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Tagging a notification allows you to replace existing notifications with the same tag with this new notification
pub fn color<S>(&mut self, color: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
The color of the icon, in #rrggbb format
pub fn click_action<S>(&mut self, click_action: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
What happens when the user clicks on the notification. Refer to https://developers.google.com/cloud-messaging/http-server-ref#table2 for details.
pub fn body_loc_key<S>(&mut self, body_loc_key: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Set the body key string for localization
pub fn body_loc_args<S>(
&mut self,
body_loc_args: Vec<S>
) -> &mut NotificationBuilder where
S: Into<String>,
[src]
&mut self,
body_loc_args: Vec<S>
) -> &mut NotificationBuilder where
S: Into<String>,
String value to replace format specifiers in the body string.
pub fn title_loc_key<S>(&mut self, title_loc_key: S) -> &mut NotificationBuilder where
S: Into<String>,
[src]
S: Into<String>,
Set the title key string for localization
pub fn title_loc_args<S>(
&mut self,
title_loc_args: Vec<S>
) -> &mut NotificationBuilder where
S: Into<String>,
[src]
&mut self,
title_loc_args: Vec<S>
) -> &mut NotificationBuilder where
S: Into<String>,
String value to replace format specifiers in the title string.
pub fn finalize(self) -> Notification
[src]
Complete the build and get a Notification
instance