Choose custom sound for local notifications

后端 未结 6 852
囚心锁ツ
囚心锁ツ 2020-11-27 15:31

How do you change the sound that plays for local notifications? I use the code below to play the default sound:

notif.soundName = UILocalNotificationDefaultS         


        
6条回答
  •  感情败类
    2020-11-27 15:58

    Swift 5.1

    How do you change the sound that plays for local notifications. I use the code below to play the default sound:

    content.sound = UNNotificationSound.init(named: UNNotificationSoundName(rawValue: "Sound_Name.mp3"))
    
    

提交回复
热议问题