katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.56k stars 1.75k forks source link

Custom sound not working on IOS 10 #1297

Closed abidvf closed 6 years ago

abidvf commented 7 years ago

Provide a general summary of the issue.

## Your Environment

Plugin version: Platform: IOS OS version: 10.2 Device manufacturer / model: iPhone 6 Plus Cordova version (cordova -v): 6.5.0 Cordova platform version (cordova platform ls): IOS 4.3.1 Plugin config

## Expected Behavior I am trying to set the custom sound option for notification and it should sound like what I try to set the custom sound to it.

Tell us what happens instead

It doesn't trigger any sound that I am trying to set it for IOS. Here is my code below.

reminderArray.push({ id: 8, text: "Its Isha Time", at: _5_sec_from_now, icon: 'file://img/logo.png', sound: settings[8] ? 'res://platform_default' : (isAndroid ? 'file://audio/azan.wav' : 'file://audio/azan.caf'), every: "day" });

A quick response will highly be appreciated.

Cheers

rwillett commented 7 years ago

@abidvf

I don't think custom sounds work on IOS, they do on Android. If I get chance this week, I might see if they work for me.

katzer commented 7 years ago

@abidvf The iOS-10 code isn't perfect yet. As far as I can remember the sound was working, at least with 10.0.x However I had to make sure manually that the app had the right permissions to play notification sounds.

abidvf commented 7 years ago

@katzer I have tried with different file formats for IOS but no success.

egdbear commented 7 years ago

Be sure that your audio directory is inside www. Also check if sound notifications volume are turned on in Settings > Sounds > Ringer and Alert (scroller).

katzer commented 6 years ago

With a .caf sound file located under www folder for example it works pretty well.