How to remove old notification channels?
Asked Answered
V

1

22

My app now has 3 notification channels, I want to remove 2 of them.
I thought simply not registering 2 channels would do the trick but when I open the notification settings on the Android device, the old channels still appear.
Is it possible to remove them? They have no use and can confuse the users.

Velocity answered 11/8, 2018 at 17:7 Comment(0)
C
38

Notification channels stay forever once they are created.

To remove them again, simply call deleteNotificationChannel() on the NotificationManager with the ID of the channel you want to delete:

notificationManager.deleteNotificationChannel("channel_id");
Caraviello answered 11/8, 2018 at 17:25 Comment(5)
Thank you. it works. Just FYI Android adds 'x categories deleted' message on the app notifications screen.Velocity
@Velocity Did you find any solution to remove 'x categories deleted' ?Manual
@deraxnumber sorry, no luckVelocity
@Velocity us.community.samsung.com/t5/Galaxy-S-Phones/…Medulla
You can also disable a channel, without deleting it by updating its importance to NONE.Klondike

© 2022 - 2024 — McMap. All rights reserved.