iOS 检测用户是否开启应用的麦克风权限

AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
switch (authStatus) {
    case AVAuthorizationStatusNotDetermined:
        
        break;
    case AVAuthorizationStatusRestricted:
        
        break;
    case AVAuthorizationStatusDenied:
        未开启
        break;
    case AVAuthorizationStatusAuthorized:
        已开启
        break;
        
    default:
        break;
}

你可能感兴趣的:(iOS 检测用户是否开启应用的麦克风权限)