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