cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Sound doest work in Android

Open Absant94 opened this issue 3 years ago • 1 comments

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?

Absant94 avatar Aug 01 '21 18:08 Absant94

Did you found the solution? I'm facing the same issue.

mayankkataria avatar Jan 28 '22 14:01 mayankkataria