首页 > 其他 > 详细

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

时间:2015-09-22 18:39:10      阅读:237      评论:0      收藏:0      [点我收藏+]
技术分享
+(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

 

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

原文:http://www.cnblogs.com/liaods/p/4829511.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!