Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification Channel sound uri should not be based on fragile resource ids #94

Merged

Conversation

emilyfeder
Copy link

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).

Emily Feder added 2 commits October 15, 2019 14:04
…ficationChannel and showNotification

Added explanation of the change to the readme.
@m1ga
Copy link
Collaborator

m1ga commented Oct 16, 2019

@emilyfeder Thank you for the PR! I'll test it soon. Looking good already 👍

@m1ga m1ga self-assigned this Oct 28, 2019
@m1ga
Copy link
Collaborator

m1ga commented Nov 4, 2019

sorry that it took so long. Just tried the PR:

  • starting the app: notification channel visible in the app settings
  • running fcm.deleteNotificationChannel("my_channel") and checking the apps settings: channel is gone
  • reopening the app (to create the channel again): channel is back in the app settings

✔️ working fine!

@m1ga m1ga self-requested a review November 4, 2019 19:47
@m1ga m1ga merged commit 3672a97 into hansemannn:master Dec 3, 2019
@emilyfeder emilyfeder deleted the ef/android-2.0.3-notification-channel-edits branch December 11, 2019 22:13
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.

2 participants