iOS录音相关

权限判断

 AVAuthorizationStatus microPhoneStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
    switch (microPhoneStatus) {
        case AVAuthorizationStatusDenied:
        case AVAuthorizationStatusRestricted:
        {
            // 被拒绝
            [self goMicroPhoneSet];
        }
            break;
        case AVAuthorizationStatusNotDetermined:
        {
            // 没弹窗
           AVAudioSession *avSession = [AVAudioSession sharedInstance];
                       
                       if ([avSession respondsToSelector:@selector(requestRecordPermission:)]) {
                           
                           [avSession requestRecordPermission:^(BOOL available) {
                               
                           }];
                       }
        }
            break;
        case AVAuthorizationStatusAuthorized:
        {
            // 有授权
        }
            break;

        default:
            break;
    }

你可能感兴趣的:(ios,safari,p2p)