[Solved] Local Notification's sound not working

Hello,

I am using Local Notification plugin and using Native Ringtone to set sound. But the content:// uri is not working with Local Notification.

this.localNotifications.schedule({
      text: 'Delayed ILocalNotification',
      data: { id: 1 },
      at: new Date(new Date().getTime() + 5000),
      led: 'FF0000',
      sound: 'content://media/internal/audio/media/19'
    });

Please let me know how can i use Native Ringtone uri in Local Notifications.

Thanks in Advance.

Issue solved by using file path plugin:

this.filePath.resolveNativePath('content://media/internal/audio/media/19')
    .then(filePath => {
      console.log(filePath);
      this.localNotifications.schedule({
        text: 'Delayed ILocalNotification',
        data: { doseid: 1 },
        at: new Date(new Date().getTime() + 5000),
        led: 'FF0000',
        sound: filePath
      });
    })
    .catch(err => console.log(err));
1 Like

Hi,
I tried this but no luck for me. Can you describe more?