plugins icon indicating copy to clipboard operation
plugins copied to clipboard

@nativescript/local-notifications custom sound not working

Open jeanpaulattard opened this issue 2 years ago • 1 comments

Hi All, I've been trying to look out for a solution on the internet, and even tried to understand the source code with no avail.

I'm trying to schedule a local notifications as follows

LocalNotifications.schedule([ {
            id: id,
            title: `Some title`,
            sound: 'res://silent.wav',
            ongoing: true,
            notificationLed: false,
            forceShowWhenInForeground: false,
            priority: 0,
            actions: actions,
            icon: 'res://icon',
        } ])

and the notification is displayed correctly. And that's fine. The only problem is that the sound file which I am specifying is not being played, and instead the default android notification sound of the device is playing.

I've even tried using silent.wav and silent as values... I even tried passing <any>null as indicated in the README but nothing worked.

The silent.wav file is located in App_Resources/Android/src/main/res/raw and App_Resources/iOS respectively

Something worth mentioning is that I've been trying this out on Android 11.

Any help and pointers would be greatly appreciated.

jeanpaulattard avatar Apr 08 '22 10:04 jeanpaulattard

up, problems that are still not resolved up to the current version

atmanegara avatar Jan 22 '24 19:01 atmanegara