Miroslav Kovac Miroslav Kovac - 7 months ago 54
iOS Question

Check AVAudioSession record permission status

Is it possible to check the record permission status (if it is granted or not) without initiating standard iOS request flow?

For example, if I would like to know if record permission is granted, but without calling

[AVAudioSession sharedInstance]
which will make iOS present prompt to the user about allowing access to the microphone.

I am looking something similar to the CLLocationManager's authorizationStatus kCLAuthorizationStatusNotDetermined



In iOS 8, they added a new property to AVAudioSession:

[AVAudioSession sharedInstance].recordPermission

That returns a AVAudioSessionRecordPermission:

enum {
   AVAudioSessionRecordPermissionUndetermined     = 'undt',
   AVAudioSessionRecordPermissionDenied           = 'deny',
   AVAudioSessionRecordPermissionGranted          = 'grnt'
typedef NSUInteger  AVAudioSessionRecordPermission;

But there doesn't seem to be a way in iOS 7.