Struct gcm::NotificationBuilder
[−]
[src]
pub struct NotificationBuilder<'a> { /* fields omitted */ }
A builder to get a Notification
instance.
Examples
use gcm::NotificationBuilder; let notification = NotificationBuilder::new("India vs. Australia") .body("3 runs to win in 1 ball") .finalize();
Methods
impl<'a> NotificationBuilder<'a>
[src]
fn new(title: &'a str) -> NotificationBuilder<'a>
Get a new NotificationBuilder
instance, with a title.
fn body(&mut self, body: &'a str) -> &mut NotificationBuilder<'a>
Set the body of the notification
fn icon(&mut self, icon: &'a str) -> &mut NotificationBuilder<'a>
Set the notification icon. Defaults to myicon
fn sound(&mut self, sound: &'a str) -> &mut NotificationBuilder<'a>
Set the sound to be played
fn badge(&mut self, badge: &'a str) -> &mut NotificationBuilder<'a>
Set the badge for iOS notifications
fn tag(&mut self, tag: &'a str) -> &mut NotificationBuilder<'a>
Tagging a notification allows you to replace existing notifications with the same tag with this new notification
fn color(&mut self, color: &'a str) -> &mut NotificationBuilder<'a>
The color of the icon, in #rrggbb format
fn click_action(
&mut self,
click_action: &'a str
) -> &mut NotificationBuilder<'a>
&mut self,
click_action: &'a str
) -> &mut NotificationBuilder<'a>
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(
&mut self,
body_loc_key: &'a str
) -> &mut NotificationBuilder<'a>
&mut self,
body_loc_key: &'a str
) -> &mut NotificationBuilder<'a>
Set the body key string for localization
fn body_loc_args(
&mut self,
body_loc_args: Vec<&'a str>
) -> &mut NotificationBuilder<'a>
&mut self,
body_loc_args: Vec<&'a str>
) -> &mut NotificationBuilder<'a>
String value to replace format specifiers in the body string.
fn title_loc_key(
&mut self,
title_loc_key: &'a str
) -> &mut NotificationBuilder<'a>
&mut self,
title_loc_key: &'a str
) -> &mut NotificationBuilder<'a>
Set the title key string for localization
fn title_loc_args(
&mut self,
title_loc_args: Vec<&'a str>
) -> &mut NotificationBuilder<'a>
&mut self,
title_loc_args: Vec<&'a str>
) -> &mut NotificationBuilder<'a>
String value to replace format specifiers in the title string.
fn finalize(&mut self) -> Notification<'a>
Complete the build and get a Notification
instance