kavie
kavie

Reputation: 2244

Notification Channel Id Should be Unique for Each Notification

Since Android 8 notification channels required for notifications. My Question is each and every notification should have different notification channel Id or same channel Id?

Upvotes: 2

Views: 1790

Answers (2)

Smeet
Smeet

Reputation: 4116

Ok very good question, I am sure, I am late to answer but today I came across same problem. Actually I am showing multiple notification and when I long press on it and click on turn off notifications for my app, I came to know that same channel is being added multiple times as shown below:

enter image description here

So as and when I show the notification, I was using unique channel id while showing the notification, so even though notification channel name is same but channel id is different & unique, it keeps adding new channel each time I show the notification, that is completely wrong. It unnecessary ads multiple channels, very hard to turn off notification and many more reason.

So, in short, while you show particular group's notification, please use same channel name and channel id. Notification of particular type is grouped under channel id, not the channel name technically. But user can see the channel name only when he wants to turn it off.

Hope this answer your query and it will also help to others who are facing same issue of duplicate or multiple channels being created on each notification.

Upvotes: 0

Rene Ferrari
Rene Ferrari

Reputation: 4216

Notification channels let you group related types of notifications together.

Why would you need that?

A user may only want to disable notifications for a specific type. Let's say in a Calendar App he may want to disable all notifications which are of type reminder. Instead of disabling all notifications, the user (if a channel for reminders exists) can now specifically say: Ok I only want to disable reminder notifications.

In short: It enables the user to filter notifications more granular.

Just provide a different notification channel for each different notification "type" (meaning: they do not relate to each other).

Upvotes: 4

Related Questions