摄像头监测是否“授权”
时间:2014-10-13 17:59:18
收藏:0
阅读:332
ios7苹果公司加入了摄像头隐私设置选项:
在app中监测手机摄像头是否授权给APP:
#define PHOTOGRAPH_ACCREDIT \
if(VALID_VERSION(7.0)){\if(!([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusAuthorized)){\
UIAlertView * alt = [[UIAlertView alloc] initWithTitle:@"未获得授权使用摄像头" message:@"请在iOS\"设置中\"-\"隐私\"-\"相机\"中打开" delegate:self cancelButtonTitle:nil otherButtonTitles:@"知道了", nil];\
[alt show];\
return;\
}\
}
我写了一个宏,在调用摄像头的地方前面加入(PHOTOGRAPH_ACCREDIT;),若没有在系统“设置”-“隐私”开启摄像头就会有这样的效果:
原文:http://blog.csdn.net/u012460084/article/details/40048079
评论(0)