Miroslav Kovac Miroslav Kovac - 1 year ago 103
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


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download