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

+(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

 

posted on 2015-09-22 17:05  Baymax01  阅读(228)  评论(0编辑  收藏  举报

导航