pub struct Channel { /* private fields */ }Expand description
A notification channel, the category users configure notification behavior on.
Notifications reference a channel through
NotificationBuilder::channel_id and are not
delivered when the channel does not exist. Only available on Android.
Use Channel::builder to construct one.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn builder(id: impl Into<String>, name: impl Into<String>) -> ChannelBuilder
pub fn builder(id: impl Into<String>, name: impl Into<String>) -> ChannelBuilder
Creates a builder for a channel with the given identifier and user visible name.
Lights and vibration are disabled, the importance defaults to Importance::Default
and the remaining settings default to None;
call ChannelBuilder::build to get the Channel.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
The user visible description of this channel.
Sourcepub fn sound(&self) -> Option<&str>
pub fn sound(&self) -> Option<&str>
The name of the sound resource played by the notifications of this channel.
The resource must be placed in the app’s res/raw folder.
Sourcepub fn light_color(&self) -> Option<&str>
pub fn light_color(&self) -> Option<&str>
The color of the device light, as a color string such as #ff0000.
Sourcepub fn importance(&self) -> Importance
pub fn importance(&self) -> Importance
How much the notifications of this channel interrupt the user.
Sourcepub fn visibility(&self) -> Option<Visibility>
pub fn visibility(&self) -> Option<Visibility>
How much of the notifications of this channel is shown on the lock screen.
Visibility::Private is used when this is None.