How do you change the sound that plays for local notifications? I use the code below to play the default sound:
notif.soundName = UILocalNotificationDefaultS
For Swift 3 use UNNotificationSound.init for the notif object in notification scheduling function.
Here's a Swift 3 example:
func scheduleNotifications(inSeconds: TimeInterval, completion: @escaping (_ Success: Bool) ->()){
...
notif.sound = UNNotificationSound.init(named: "CustomSound.mp3")
...
}
Final note, according to Apple: "The sound file must be contained in the app’s bundle or in the Library/Sounds folder of the app's data container. If files exist in both locations then the file in ~/Library/Sounds will be preferred."