Custom Notification Sound Not Playing
See original GitHub issueBug
Environment info
react-native info
output:
System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Memory: 84.60 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.12.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 15, 23, 24, 26, 27, 28, 29
Build Tools: 22.0.1, 24.0.1, 27.0.3, 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
npmPackages:
react: 16.13.1 => 16.13.1
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
react-native-cli: 2.0.1
react-native: 0.61.4
Library version: 3.4.0
Steps To Reproduce
- Put
sound.mp3
in iOSResources/
folder - Call
PushNotification.localNotification
Describe what you expected to happen:
I received the notification, but no sound is played. I expected the notification to play my custom sound sound.mp3
.
Reproducible sample code
PushNotification.localNotification({
autoCancel: true,
smallIcon: 'ic_stat',
subText: 'Notification',
color: appColors.accent,
vibrate: true,
title: message.data.title,
message: message.data?.message,
soundName: 'sound.mp3',
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
A reason why custom notification sound might not work on ...
First of all, we should remove the notification channel and create a new one with a new notification channel id. Secondly, we should...
Read more >Top 10 Ways to Fix Notification Sound Not Working on Android
1. Check Notification Volume · 2. Enable Sound Profile · 3. Turn off DND · 4. Check Notification Sound Settings for Apps ·...
Read more >Windows 10 Pro will not play custom notification sound
My WAV sound file is fine, I can click it and Groove music or Windows media player will play it just fine. Through...
Read more >custom notification sound not play… | Apple Developer Forums
Our app uses custom notifications sounds which have been working fine when the app is open and when closed or in background mode....
Read more >Custom Notification Sound not working in Android Oreo
To set a sound to notifications in Oreo, you must set sound on NotificationChannel and not on Notification Builder itself.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
remove .mp3 (‘sound.mp3’ to ‘sound’) then it works!!!
I didnt know channelId rules use only alphabet(lowercase), number and hyphen character