Commit d212ac4f authored by 林生雨's avatar 林生雨

commit

parent a4dd2854
......@@ -78,8 +78,7 @@ NSString *cacheDirectory;
else if(author == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) {
NSLog(@"没给权限!!!");
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。";
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
[self popWindow:errorStr];
}else {
NSLog(@"HERRRRRRRR");
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
......@@ -93,8 +92,7 @@ NSString *cacheDirectory;
dispatch_async(dispatch_get_main_queue(), ^{
// 用户点击 不允许访问
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。";
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
[self popWindow:errorStr];
NSLog(@"被拒绝 TODO!!");
});
}
......@@ -113,9 +111,7 @@ NSString *cacheDirectory;
else if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相机”选项中,允许好享玩访问你的相机。";
NSLog(@"相机不可用");
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
[self popWindow:errorStr];
}else {
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
if(granted){
......@@ -124,8 +120,7 @@ NSString *cacheDirectory;
});
}else{
NSString *errorStr = @"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。";
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:errorStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
[self popWindow:errorStr];
}
}];
}
......@@ -925,6 +920,17 @@ CFAbsoluteTime startTime;
return videoDurationText;
}
-(void)popWindow:(NSString*)str{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:str preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"确定");
}];
[alertController addAction:okAction];
[viewController presentViewController:alertController animated:YES completion:nil];
}
//-(void)execRealImg:(long)resultId{
// dispatch_queue_t queue = dispatch_queue_create("execRealImg", DISPATCH_QUEUE_CONCURRENT);
// self.nowSize=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment