cordova-plugin-local-notifications
cordova-plugin-local-notifications copied to clipboard
Notification Sound not Working
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN! I'm working on a react project ,and want to use my own sound for the notification. i imported the sound and put it in the set Default object. cordova.plugins.notification.local.setDefaults({ sound: notifSound });
Your Environment
- Plugin version:0.9.0
- Platform:android
- OS version:9
- Device manufacturer / model: xiami mi 8
- Cordova version (
9.0.0
): - Cordova platform version (``android 8.0.0```):
- Plugin config
- Ionic Version (if using Ionic)
Expected Behavior
use the imported sound instead of default sound for notification.
Tell us what should happen
Actual Behavior
Tell us what happens instead
Steps to Reproduce
Reproduce this issue; include code to reproduce, if relevant
- ...
- ...
- ...
- ....
Context
What were you trying to do?
Debug logs
Include iOS / Android logs
- ios XCode logs
- Android: $ adb logcat
I have the same issue. Same code works fine on iOS but the default notification sound is played on Android.
I know this is old, but the reason for this is that the custom sound is not being added to the notification channel for Android 8, 9, 10.
I have it working in this fork (and I think there are some other forks that addressed this as well): https://github.com/timkellypa/cordova-plugin-local-notifications
I know this is old, but the reason for this is that the custom sound is not being added to the notification channel for Android 8, 9, 10.
I have it working in this fork (and I think there are some other forks that addressed this as well): https://github.com/timkellypa/cordova-plugin-local-notifications
@timkellypa i am using your fork, how to use custom sound with notification channel with that?
I have tried to put
sound: 'channel_id'
but it's not working.
Your example would be much appreciated. Thanks.