Asks the user to allow your app to perform speech recognition.
- iOS 10.0+
The block to execute when your app's authorization status is known. The status parameter of the block contains your app's authorization status. The system does not guarantee the execution of this block on your app's main dispatch queue.
Call this method before performing any other tasks associated with speech recognition. This method executes asynchronously, returning shortly after you call it. At some point later, the system calls the provided
handler block with the results.
When your app's authorization status is
SFSpeech, 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
NSSpeech key of your app's
Info file. The user's response is saved so that future calls to this method do not prompt the user again.
For more information about requesting authorization, see Asking Permission to Use Speech Recognition.