Android: No custom sound
See original GitHub issueHi,
I am having issues with playing a custom sound on android after I upgraded to API 26. The sound worked before this upgrade and currently works in iOS.
I am using RN 0.56.1 and have updated the package to 3.1.2, added a channel name and description in my android manifest as per the readme (this issue occured in 3.1.1 too).
The code below is used to schedule a local notification:
PushNotification.localNotificationSchedule({
id: id,
number: 0,
userInfo: {
id: id,
...payload,
},
title: "My title",
message: "My message",
date: moment().add(30, 'seconds').toDate(),
soundName: 'alarm.mp3',
repeatType: 'minute',
data: JSON.stringify(payload),
priority: "max",
importance: "max",
visibility: "public",
autoCancel: false,
});
alarm.mp3 exists in /app/src/main/res/raw/ folder and is 30 seconds long.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:20
Top Results From Across the Web
A reason why custom notification sound might not work on ...
When we use custom sound for a notification channel, we might observe that system shows notifications without sound. Playing custom sound ...
Read more >Android Custom Notification sound is Not working?
I am getting the custom sound name from the notification and added conditions based on key but always sound only playing in my...
Read more >How to Change Android Notification Sounds - Lifewire
How to Add Custom Notification Sounds · Go to Settings > Apps & notifications > Notifications. · Scroll down and tap Advanced >...
Read more >Notification Sounds - OneSignal Documentation
Send Notifications With or Without Sounds. Android & Amazon. Android 8+ introduced Notification Categories which must be setup to customize notification sounds.
Read more >Customize notification sounds on Android - Atlassian Support
You can customize sounds for each alert action, select an awakening sound for New Alerts and a different sound for Schedule Starts. These...
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
@zo0r PR https://github.com/zo0r/react-native-push-notification/pull/1042 is very much needed. Could you please do something to make it merged?
This fork https://github.com/MaximusBaton/react-native-push-notification has been the only one that works for me. Unfortunately it’s behind a few versions, but it’ll have to do for now until we can get an official fix.