I'm trying to customize the sound for a notification using Cordova . I'm using the Cordova Local Notification plugin, but the sound does not play when I display the notification.
Tests performed:
- I tried to use custom sound in
SDCard
: worked! - I tried to use the sound for a URL: did not work but it's not what I need
- I tried to use a sound that is in the folder
www
calledbeep.mp3
: did not work, and that's what I need
Testing on Android , more precise that works on iOS as well.
Here is the code I'm trying to implement:
window.plugin.notification.local.add({
id: id,
title: titulo,
message: msg,
sound: (config.platform_compilation != 'IOS') ? 'file:///android_assets/www/beep.mp3' : 'www/audio/beep.mp3',
date: DateOBJ
});
My check of config.platform_compilation
is correct, the problem is when I try to play the sound that is in www
, if I put this file in SDCard
and change the path at compile time, it works, but I need this sound within the APK / APP to make it available.