File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import LoopKit
10
10
import UIKit
11
+ import AudioToolbox
11
12
12
13
public protocol UserNotificationCenter {
13
14
func add( _ request: UNNotificationRequest , withCompletionHandler: ( ( Error ? ) -> Void ) ? )
@@ -84,8 +85,12 @@ fileprivate extension Alert {
84
85
85
86
switch sound {
86
87
case . vibrate:
88
+ guard interruptionLevel == . critical else {
89
+ AudioServicesPlayAlertSound ( kSystemSoundID_Vibrate)
90
+ return nil
91
+ }
87
92
// setting the audio volume of critical alert to 0 only vibrates
88
- return interruptionLevel == . critical ? . defaultCriticalSound( withAudioVolume: 0 ) : nil
93
+ return . defaultCriticalSound( withAudioVolume: 0 )
89
94
default :
90
95
if let actualFileName = AlertManager . soundURL ( for: self ) ? . lastPathComponent {
91
96
let unname = UNNotificationSoundName ( rawValue: actualFileName)
You can’t perform that action at this time.
0 commit comments