mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix record permission callback thread
This commit is contained in:
parent
e539f81f19
commit
a2b69da52e
@ -282,24 +282,26 @@ public final class DeviceAccess {
|
|||||||
completion(true)
|
completion(true)
|
||||||
} else {
|
} else {
|
||||||
AVAudioSession.sharedInstance().requestRecordPermission({ granted in
|
AVAudioSession.sharedInstance().requestRecordPermission({ granted in
|
||||||
if granted {
|
Queue.mainQueue().async {
|
||||||
completion(true)
|
if granted {
|
||||||
} else if let presentationData = presentationData {
|
completion(true)
|
||||||
completion(false)
|
} else if let presentationData = presentationData {
|
||||||
let text: String
|
completion(false)
|
||||||
switch microphoneSubject {
|
let text: String
|
||||||
case .audio:
|
switch microphoneSubject {
|
||||||
text = presentationData.strings.AccessDenied_VoiceMicrophone
|
case .audio:
|
||||||
case .video:
|
text = presentationData.strings.AccessDenied_VoiceMicrophone
|
||||||
text = presentationData.strings.AccessDenied_VideoMicrophone
|
case .video:
|
||||||
case .voiceCall:
|
text = presentationData.strings.AccessDenied_VideoMicrophone
|
||||||
text = presentationData.strings.AccessDenied_CallMicrophone
|
case .voiceCall:
|
||||||
}
|
text = presentationData.strings.AccessDenied_CallMicrophone
|
||||||
present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: {
|
}
|
||||||
openSettings()
|
present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: {
|
||||||
})]), nil)
|
openSettings()
|
||||||
if case .voiceCall = microphoneSubject {
|
})]), nil)
|
||||||
displayNotificationFromBackground(text)
|
if case .voiceCall = microphoneSubject {
|
||||||
|
displayNotificationFromBackground(text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user