Fix crash when placing call

// FREEBIE
This commit is contained in:
Michael Kirk 2017-05-01 11:13:24 -04:00
parent b9a56fe81d
commit 1b66e0ba26

View file

@ -50,13 +50,15 @@ import Foundation
// Alternative way without prompting for permissions:
// if AVAudioSession.sharedInstance().recordPermission() == .denied {
AVAudioSession.sharedInstance().requestRecordPermission { isGranted in
// Here the permissions are either granted or denied
guard isGranted == true else {
Logger.warn("\(self.TAG) aborting due to missing microphone permissions.")
self.showNoMicrophonePermissionAlert()
return
DispatchQueue.main.async {
// Here the permissions are either granted or denied
guard isGranted == true else {
Logger.warn("\(self.TAG) aborting due to missing microphone permissions.")
self.showNoMicrophonePermissionAlert()
return
}
callUIAdapter.startAndShowOutgoingCall(recipientId: recipientId)
}
callUIAdapter.startAndShowOutgoingCall(recipientId: recipientId)
}
return true
}