您的位置:首页 > 其它

查询是否有权限访问相机和相册

2015-09-22 17:05 330 查看
+(BOOL)getSystemPhotoAuthority
{
BOOL agree=NO;
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if(authStatus == AVAuthorizationStatusAuthorized||authStatus == AVAuthorizationStatusNotDetermined)
{
agree=YES;
}else
{
agree=NO;
}
return agree;
}
+(BOOL)getSystemImageAuthority
{
BOOL agree=NO;
ALAuthorizationStatus author = [ALAssetsLibrary authorizationStatus];
if(author == ALAuthorizationStatusAuthorized||author == ALAuthorizationStatusNotDetermined)
{
agree=YES;
}else
{
agree=NO;
}
return agree;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: