Created
December 3, 2025 08:28
-
-
Save burakekmen/808d877172f0d8a2d752e3cb81d8e895 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func requestPermissions(completion: @escaping (Bool) -> Void) { | |
| // 1. Request Speech Authorization | |
| SFSpeechRecognizer.requestAuthorization { [weak self] authStatus in | |
| guard authStatus == .authorized else { | |
| completion(false) | |
| return | |
| } | |
| // 2. Request Microphone Authorization | |
| AVAudioSession.sharedInstance().requestRecordPermission { granted in | |
| completion(granted) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment