cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Notification Sound not Working

Open Rickk137 opened this issue 5 years ago • 3 comments

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

  1. ...
  2. ...
  3. ...
  4. ....

Context

What were you trying to do?

Debug logs

Include iOS / Android logs

  • ios XCode logs
  • Android: $ adb logcat

Rickk137 avatar Sep 18 '19 21:09 Rickk137

I have the same issue. Same code works fine on iOS but the default notification sound is played on Android.

emilycestmoi avatar Nov 07 '19 19:11 emilycestmoi

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 avatar May 22 '20 23:05 timkellypa

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.

ekohadim avatar May 20 '21 17:05 ekohadim