2
I’m trying to customize the sound for a notification using the Cordova. I am using the plugin Cordova Local Notification, but the sound is not played when displaying the notification.
Tests carried out:
- I tried using custom sound on
SDCard
: worked! - I tried to use the sound by a URL: didn’t work, but it’s not what I need
- I tried to use a sound that stays in the folder
www
calledbeep.mp3
: didn’t work, and that’s what I need
Tests carried out on Android, more precise to work on iOS also.
Below 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 verification of the config.platform_compilation
is correct, the problem is when you try to play the sound that is in www
, if I put this file in the SDCard
and I change the path at compilation time, it works, but I need that sound inside the APK/APP to make available.