Menu

1 / 2

expo-notifications custom sound plays the default tone in release builds: R8 deleted it

DEV Community: reactnative·Mohamed Gado·about 7 hours ago
#3nRxwZ8X
Long article (902 words) — no AI summary yet.
Reading 0:00
15s threshold

Rafiq , my prayer times app, plays the adhan as a notification sound. A user wrote that the notification arrived but the adhan did not play. Debug builds were fine, the emulator was fine and 1,814 tests were green. On every release build, the phone played its ordinary notification tone.

The symptom

The notification arrives on time.

The sound is the system default instead of your file.

It only happens in release builds with resource shrinking on.

No error is logged anywhere.

Read the channel before the code

My first move was to reread the scheduler, which was a waste. Android owns the channel, so ask Android:

adb shell dumpsys notification

Enter fullscreen mode

Exit fullscreen mode

Find your channel in the output and read mSound . Mine said:

mSound=content://settings/system/notification_sound

Enter fullscreen mode

Exit fullscreen mode

The channel had been created with the wrong sound. Nothing about scheduling could cause or fix that.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.