LocalNotification Plugin Sound Not Working On Android10

I’m trying for more than 5 hours to find out why the LocalNotification sound is not working on my Android 10 phone but work on the bellow versions. tried on 9,8 and 7.

I’ve debugged all the java plugin code, tried all the tricks that could be found on all the possible forums but unfortunately without success.

So if some one can help me with a magic fix, that would be great :slight_smile: :star_struck:


Below is the code that already works on the other Android versions:

1- Package.json

"@capacitor/local-notifications": "^1.0.9"

2- Service

public async fireOrderReadyNotification(msg: Message) {
    const result = await LocalNotifications.listChannels();
    if (result.channels.find(ch => ch.id === 'mychannel') === undefined) {
      const channel1: Channel = {
        id: 'mychannel',
        name: 'channel',
        sound: 'bell.wav',
        lightColor: '#f49c21',
        importance: 3,
        visibility: 1,
        vibration: true,
        lights: true
      }
      await LocalNotifications.createChannel(channel1);
    }

    const notifs = await LocalNotifications.schedule({
      notifications: [
        {
          id: 1
          title: "Notification title",
          body: 'Short blablaaa',
          largeBody: "large blablaaaaa body",
          channelId: 'mychannel'
          sound: "bell.wav"
        }
      ]
    });
  }

I also have a default configuration in my capacitor.config.json but it’s optional.

Found the solution !

importance must be set to 5 so that the system consider it as [IMPORTANCE_HIGH] and enable by default sounds on notifications.

Otherwise users should enable it the app settings.