I need to update the sound of the Android Notification Channel. I did research on this and concluded that we cannot update the properties of channel except name and description. I need to update the sound and i don't want to create as many channels for multiple sounds. How I can override the channel sound android notification channel?
Asked
Active
Viewed 286 times
0
-
check this https://stackoverflow.com/a/52394173/8528047 – Pemba Tamang Oct 03 '19 at 12:08
-
This is not the valid solution. Once you create the channel you cannot modify except the description – Qumber Abbas Oct 03 '19 at 12:54
1 Answers
0
Save Notification Channel ID and when you want to change the tone of channel just delete the notification channel with ID and set new Channel ID (Even if you use same notification channel id you'll get same settings as previous).
-
I dont think this will be the right approach, suppose we have 1000 media files and I have one channel then how could i rename a channel 1000 times. I dont know why Android doesnt provide such flexibility of changing the channel settigns – Qumber Abbas Oct 03 '19 at 12:53
-
I didn't get you what do you mean by 1000 media files. Can you please eloborate the problem you are getting. – Oct 03 '19 at 14:24
-
Either export your media files to the Notifications directory on the phone so the user can change the sound manually in the OS (like Android intends). Or simply update the ID everytime the user changes sound (you don't need to rename it for every sound you have, only for every time the user changes sound) – poppe Feb 13 '20 at 09:30
-
Same channel id won't change sound because android keeps record of deleted channels. – Sanaullah Javeid Apr 06 '23 at 08:55