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