//如果没有权限,iOS10以下用弹窗提醒;iOS10直接跳到“设置”中去
- (void)cameraAuthorizationAlert {
NSString *versionNum = [[UIDevice currentDevice] systemVersion];
NSLog(@"版本号:%@",versionNum);
if([versionNumfloatValue] >=10.0) {
// 无权限 引导去开启
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication]canOpenURL:url]) {
[[UIApplication sharedApplication]openURL:url];
}
}
else{
UIAlertView*alert = [[UIAlertViewalloc]initWithTitle:@"提示" message:@"’微模识’需要访问您的相机,是否去设置?" delegate:selfcancelButtonTitle:@"取消"otherButtonTitles:@"确定",nil];
[alertshow];
}
}