Home > AI > IOS > Speech >

requestAuthorization(_:)

Asks the user to allow your app to perform speech recognition.

When your app’s authorization status is SFSpeechRecognizerAuthorizationStatus.notDetermined, this method causes the system to prompt the user to grant or deny permission for your app to use speech recognition. The prompt includes the custom message you specify in the NSSpeechRecognitionUsageDescription key of your app’s Info.plist file. The user’s response is saved so that future calls to this method do not prompt the user again.

Important

Your app’s Info.plist file must contain the NSSpeechRecognitionUsageDescription key with a valid usage description. If this key is not present, your app will crash when you call this method.

Leave a Reply