(IOS)几个常用权限判断

if([CLLocationManager authorizationStatus] ==kCLAuthorizationStatusDenied) {

    NSLog(@"没有定位权限");

}

AVAuthorizationStatusstatusVideo = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];

if(statusVideo == AVAuthorizationStatusDenied) {

    NSLog(@"没有摄像头权限");

}

//是否有麦克风权限

AVAuthorizationStatusstatusAudio = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];

if(statusAudio == AVAuthorizationStatusDenied) {

    NSLog(@"没有录音权限");

}

[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatusstatus) {

    if(status == PHAuthorizationStatusDenied) {

        NSLog(@"没有相册权限");

    }

}];

你可能感兴趣的:((IOS)几个常用权限判断)