Closed jondspa closed 1 month ago
I was having a similar problem on newer versions of android. I resolved it by switching to timkellypa's version #1891
Great, thanks. I'll check it out!
I am trying to play sound on local notifications from my downloadable sound files in the readable and writable directory of my app's this.file.documentsDirectory
or this.file.dataDirectory
. This this.file.externalDataDirectory
works fine in android. But this.file.documentsDirectory
and this.file.dataDirectory
are not working in ios. My code is,
var audioDirectory = this.platform.is("ios") ? this.file.documentsDirectory: this.file.externalDataDirectory;
cordova.plugins.notification.local.schedule({
id: 1,
channel: "channel1",
title: 'Notification 1',
text: 'Notification 1',
foreground: true,
vibrate: true,
sound: audioDirectory + "half/sound.mp3"
})
The file path is correct and works fine with android and also I am playing it in ios with native audio with the same path.
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
It's a great plugin, been using for years! Thanks! But having trouble with custom sounds. Just get standard device notification sounds instead of my custom sounds.
Any help would be most appreciated!
Your Environment
cordova -v
): 9.0.0 for both iOS and Androidcordova platform ls
): android 8.0.1 and iOS 4.2.1Expected Behavior
Notifications would play a custom sound and not the standard phone notification sound
Actual Behavior
Plays standard phone notification sound
Steps to Reproduce
Android soundFile: `file://assets/ding.mp3' also tried 'res://ding.mp3' also tried 'file:///android_asset/www/assets/ding.mp3'
iOS soundFile = "assets/ding.mp3",