pub struct SimpleNotification {
pub(crate) title: String,
pub(crate) text: Vec<String>,
pub(crate) app_logo: String,
pub(crate) hero_image: String,
pub(crate) app_id: String,
}
impl SimpleNotification {
pub fn new(title: String) -> SimpleNotification {
SimpleNotification {
title,
text: vec![],
app_logo: "".to_string(),
hero_image: "".to_string(),
app_id: "".to_string()
}
}
pub fn set_title(mut self, title: String) -> Self{
self.title = title;
self
}
pub fn add_text(mut self, line: String) -> Self {
self.text.push(line);
self
}
pub fn set_text(mut self, text: Vec<String>) -> Self{
self.text = text;
self
}
pub fn set_app_logo(mut self, app_logo: String) -> Self {
self.app_logo = app_logo;
self
}
pub fn set_hero_image(mut self, hero_image: String) -> Self {
self.hero_image = hero_image;
self
}
pub fn set_app_id(mut self, app_id: String) -> Self {
self.app_id = app_id;
self
}
pub fn display(self) {
crate::internal::notifications::send_simple_notification(self);
}
}