首页 > 代码库 > ios判断app是否有打开相机的权限

ios判断app是否有打开相机的权限

#import <AVFoundation/AVCaptureDevice.h>

#import <AVFoundation/AVMediaFormat.h>

 

AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];

    if (authStatus == AVAuthorizationStatusRestricted ||

        authStatus ==AVAuthorizationStatusDenied){

        //无权限

    }

ios判断app是否有打开相机的权限