iOS原生OC申请麦克风权限

AVAuthorizationStatus microPhoneStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
    switch (microPhoneStatus) {
        case AVAuthorizationStatusDenied:
        case AVAuthorizationStatusRestricted:
        {
            NSLog(@"iOS原生 被拒绝  . . .");
        }
            break;
        case AVAuthorizationStatusNotDetermined:
        {
            NSLog(@"iOS原生 没弹窗  . . .");
        }
            break;
        case AVAuthorizationStatusAuthorized:
        {
            NSLog(@"iOS原生 有授权  . . .");
        }
            break;

        default:
            break;
    }
   
    [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) {
        NSLog(@"iOS原生 是否同意  . . .");
        //callback(@"code");
    }];
原文地址:https://www.cnblogs.com/Oldz/p/13341157.html