cordova-plugin-local-notifications
cordova-plugin-local-notifications copied to clipboard
Sound doest work in Android
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Provide a general summary of the issue.
Your Environment
- Plugin version: Platform: Android OS version: 11
- Device manufacturer / model:
Cordova version (
cordova -v
): 10.0.0 Cordova platform version (cordova platform ls
): Installed platforms: android 8.1.0 - Plugin config
- Ionic Version (if using Ionic): 6.13.1
Expected Behavior
Hi! Im using this plugin for first time, I was creating local notifications and these works without problem.
But when I try to add a sound, this doesnt work. I can see the notification, but I cant ear anything.
I create this Local notification in the route:
/app/pagextra/pagextra.page.ts
This is my declaration of the local notification:
showNotification(data) {
// Schedule a single notification
this.localNotifications.schedule({
id: 1,
text: JSON.stringify(data),
sound: 'file://../../assets/alerta.mp3',
data: { secret: "key" }
});
}
And the audio is placed in :
app/assets/alerta.mp3
Someone knows where is the proble and how to solve it?
Did you found the solution? I'm facing the same issue.