File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99import LoopKit
1010import UIKit
11+ import AudioToolbox
1112
1213public protocol UserNotificationCenter {
1314 func add( _ request: UNNotificationRequest , withCompletionHandler: ( ( Error ? ) -> Void ) ? )
@@ -84,8 +85,12 @@ fileprivate extension Alert {
8485
8586 switch sound {
8687 case . vibrate:
88+ guard interruptionLevel == . critical else {
89+ AudioServicesPlayAlertSound ( kSystemSoundID_Vibrate)
90+ return nil
91+ }
8792 // setting the audio volume of critical alert to 0 only vibrates
88- return interruptionLevel == . critical ? . defaultCriticalSound( withAudioVolume: 0 ) : nil
93+ return . defaultCriticalSound( withAudioVolume: 0 )
8994 default :
9095 if let actualFileName = AlertManager . soundURL ( for: self ) ? . lastPathComponent {
9196 let unname = UNNotificationSoundName ( rawValue: actualFileName)
You can’t perform that action at this time.
0 commit comments