/** 判断系统定位是否开启 */
-(BOOL)checkIsLocationServiceEnabled
{
//判断定位服务是否可用
if ([CLLocationManager locationServicesEnabled] &&
([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedAlways
|| [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined
|| [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse))
{
return YES;
}
return NO;
}
/** 判断是否开启相机访问 */
-(BOOL)checkIsCamaraServiceEnabled
{
//AVFrameRateRange
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied)
{
//无权限
return NO;
}
return YES;
}
/** 判断是否开启相册访问 */
-(BOOL)checkIsPhotoServiceEnabled
{
ALAuthorizationStatus author = [ ALAssetsLibrary authorizationStatus];
if (author == kCLAuthorizationStatusRestricted || author ==kCLAuthorizationStatusDenied){
//无权限
return NO;
}
return YES;
}