Requests the user’s permission for audio recording.
- iOS 7.0+
- watchOS 4.0+
- Mac Catalyst 13.0+Beta
A block, of type
Permission, whose sole parameter contains a Boolean value indicating whether the user granted or denied permission to record.
If, when you call this method, the user had previously granted or denied recording permission, the block executes immediately and without displaying a recording permission alert.
If the user has not yet granted or denied permission when you call this method, the system displays a recording permission alert and executes the block after the user responds to it.
Recording audio requires explicit permission from the user. The first time your app’s audio session attempts to use an audio input route while using a category that enables recording, the system automatically prompts the user for permission. You can explicitly ask earlier by calling this method. Until the user grants your app permission to record, your app can record only silence.
This method always returns immediately, but the
response block awaits user input if the user has not previously granted or denied permission to record in your app.
The block may be called in a different thread context.