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

[Bug]: Channel with custom sound fails to play sound after rebuild / update #2245

Open
1 task done
armiiller opened this issue Jan 22, 2025 · 0 comments
Open
1 task done

Comments

@armiiller
Copy link

What happened?

When trying to deploy an app update (aka rebuilding and distributing), sending notifications to a channel with a custom sound no longer play the sound. I still receive a vibration, and push notification, just the sound is not played.

This is a result of the sound Uri being built using the resources id. When doing a grade rebuild, ids will change. Thus the channel is trying to play a resource that no longer exists.

if (soundId != 0) return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + packageName + "/" + soundId)

Other similar projects have dealt with similar issues with fixes.

Steps to reproduce?

1. Build your app. Install. Run the app to create the notification channels. Send at least on push notification to the channel.
2. Build a new version, with added sound files (as to cause gradle to rebuild and remap resources). Make sure to update your version code. Install on phone that had previous version installed. Send push notification to same channel. Custom sound will not play.

What did you expect to happen?

I expected the custom channel sound to play when a push notification is received (because we are technically passing a string) and app updates/rebuilds should not cause failures.

OneSignal Android SDK version

Release 4.8.10

Android version

14

Specific Android models

Should affect all models. And all versions. It's very clear in the code that a resource path using build ids will fail.

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

No branches or pull requests

1 participant