权限判断
AVAuthorizationStatus microPhoneStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
switch (microPhoneStatus) {
case AVAuthorizationStatusDenied:
case AVAuthorizationStatusRestricted:
{
// 被拒绝
[self goMicroPhoneSet];
}
break;
case AVAuthorizationStatusNotDetermined:
{
// 没d窗
AVAudioSession *avSession = [AVAudioSession sharedInstance];
if ([avSession respondsToSelector:@selector(requestRecordPermission:)]) {
[avSession requestRecordPermission:^(BOOL available) {
}];
}
}
break;
case AVAuthorizationStatusAuthorized:
{
// 有授权
}
break;
default:
break;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)