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");
    }];

 

iOS原生OC申请麦克风权限

上一篇:syncthing安卓客户端怎么使用


下一篇:Android:ListView 和RecyclerView区别