Skip to content

Channels

Channels group notifications by type and control their behavior (sound, importance, actions). On Android, channels map directly to system notification channels. On iOS, Shiny manages channels internally.

PropertyTypeDefaultDescription
IdentifierstringrequiredUnique channel ID
Descriptionstring?nullHuman-readable description
ImportanceChannelImportanceNormalPriority level
SoundChannelSoundDefaultSound setting
CustomSoundPathstring?nullPath for custom sounds
ActionsList<ChannelAction>emptyAction buttons

Shiny provides a built-in default channel.

var defaultChannel = Channel.Default;
// Identifier: "Notifications", Importance: Low
INotificationManager notifications; // injected
// Simple channel
notifications.AddChannel(new Channel
{
Identifier = "orders",
Description = "Order notifications",
Importance = ChannelImportance.High,
Sound = ChannelSound.Default
});
// Channel with action buttons
var channel = Channel.Create("messages",
ChannelAction.Create("reply", "Reply", ChannelActionType.TextReply),
ChannelAction.Create("dismiss", "Dismiss", ChannelActionType.Destructive)
);
notifications.AddChannel(channel);
ValueDescription
LowNo sound, minimal visual
NormalDefault sound and visual
HighSound, may peek on screen
CriticalUrgent, may override DND
ValueDescription
NoneSilent
DefaultSystem default sound
HighHigh-priority sound
CustomCustom sound file (set CustomSoundPath)

Action buttons appear on the notification, allowing quick interaction.

// Text reply action
ChannelAction.Create("reply", "Reply", ChannelActionType.TextReply);
// Destructive action (red on iOS)
ChannelAction.Create("delete", "Delete", ChannelActionType.Destructive);
// Opens the app
ChannelAction.Create("open", "View", ChannelActionType.OpenApp);
// Default (no special behavior)
ChannelAction.Create("ack", "OK", ChannelActionType.None);
// Get a specific channel
var channel = notifications.GetChannel("orders");
// Get all channels
var channels = notifications.GetChannels();
// Remove a channel
notifications.RemoveChannel("orders");
// Clear all channels
notifications.ClearChannels();