Notification Channel sound uri should not be based on fragile resource ids #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I use custom push sounds in my application and therefore create different notification channels for each sound. On Android Q, I am encountering the following documented problem when my app upgrades. I have tried the solution documented here but it doesn’t actually fix my problem due to the fact that when you delete notification channels and recreate them with the same id, it uses the same sound settings it had before it was deleted. So in the current released version of my app, the sound uri’s are based on the fragile resource ids since I use this module to create notification channels.
For me the best solution for me is to create new channels with new ids and that use sound uri’s that reference the raw filename rather than the resource ids in the next version of my app. I can use those same channel ids going forward because once you create the Notification Channels with the non-resource id based uri’s, they are resilient to any changes to the resource ids. To implement this in my app, I had to make a custom version of the module. I would like these changes to be in the source module, so I’m opening this pull request.
I understand that you may want to just deprecate the createNotificationChannel function and wait for titanium to add a deleteNotificationChannel proxy to the android function (I opened a ticket with them asking for this feature), so that this can be a handled entirely by the client. (You would still need the update to use the string based sound uri in TiFirebaseMsgService.showNotification).