Skip to content

Add optional channelId to NotifierBuilder (Android) - #180

Open
Eyt-Lev wants to merge 1 commit into
mirzemehdi:mainfrom
Eyt-Lev:feat/per-notification-channel-id
Open

Eyt-Lev wants to merge 1 commit into
mirzemehdi:mainfrom
Eyt-Lev:feat/per-notification-channel-id

Conversation

@Eyt-Lev

@Eyt-Lev Eyt-Lev commented Aug 26, 2026 •

Copy link
Copy Markdown

Currently local notification now goes into the one channel that is configured at initialization (NotificationChannelData.id). Any application that creates multiple channels for notifications on Android has no way to route a particular notification.

This adds an optional channelId to NotifierBuilder:

localNotifier.notify {
    channelId = "my_channel"
    title = "..."
}

If the channel does not exist on the device (or API < 26), we log a warning and fall back to the configured default channel to ensure nothing breaks silently. The behavior remains the same if channelId is left null.

Every notification was pinned to the single channel configured at init
time, so apps defining multiple channels couldn't route individual
notifications to them. NotifierBuilder now takes an optional channelId;
if that channel doesn't exist on the device we log a warning and fall
back to the default channel.
@Eyt-Lev

Eyt-Lev commented Aug 26, 2026 •

Copy link
Copy Markdown
Author

#157 also touches this area, with a different approach: it routes via a payload key and defines all channels up front in the config (replacing notificationChannelData with a list).

This PR is additive instead: the builder-level channelId keeps the existing single-channel config untouched and works for apps that create their channels themselves.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant