Ionic 2 local notifications with sound (bug?)


#1

Hello, I am trying to shedule a local notification with a custom sound.
This works only when the app itself is opened. When it is running in the background, I get the notification, but not with my custom specified sound.

LocalNotifications.schedule({ id: 1, title: "Test title", text: "Single Notification", sound: 'file://doorbell1.mp3' });


#2

Did you place your custom sound in the www folder? I was able to get the sound to play from there.


#3

Yes I have put the file in www folder. But still not working


#4

I have such this problem when device is “vibration only” local notification vibrate device but at general mode only shows notification on top of device.

SoundNotify(){
  this.localNotifications.schedule({
  id: 1,
  text: 'Single ILocalNotification',
  sound: this.Platform.is('Android')? 'file://sound.mp3': 'file://beep.caf',
  data: { secret: "key" }
});
this.localNotifications.isPresent(1);
}