mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix crash when placing call
// FREEBIE
This commit is contained in:
parent
b9a56fe81d
commit
1b66e0ba26
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue