Asks the user to grant your app permission to perform speech recognition.
- iOS 10.0+
A block that is called when the authorization request has been approved or denied. The block takes one parameter,
status, which contains an authorization status value. The handler does not guarantee a particular execution context.
Before you call this method, be sure to add a usage description to your app's
Info file that explains why your app wants to perform speech recognition. When the user interacts with an app feature that depends on speech recognition, call this method to present an alert that displays your description and asks for the user's permission, as shown here.
The completion handler updates the status based on the user's or device's response to the request. It can work well to dispatch the operation to the main queue if your app updates the user interface according to the authorization status.