Currently I am creating an alarm app that plays custom audio clips from the server. My plan on implementing this is by saving all the audio clips locally and then setting the soundName accordingly.
But I am having a few issues. Currently I am having troubles saving the audio files in the bundle directory and only able to save the files in the document directory. Would it be possible to set the soundName from the document directory instead of the bundle directory?
OR
would it be possible for me to save the audio file from the server to the bundle directory?
var localNotification = UILocalNotification()
localNotification.fireDate = self.timePicker.date
localNotification.alertBody = "Alert Fired"
localNotification.soundName = "fakesound.caf" // File saved in Document Directory
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
Thanks, please let me know if you have any confusion with my question. Or if you can think of another solution on how I could solve this problem.
The answer, unfortunately, is no and no.
You can only play sounds from the bundle in a local notification, and the bundle is read-only.
The only sounds you can play from a local notification must be shipped with your app. No other option.