意见反馈相册权限bug
This commit is contained in:
parent
fc47921130
commit
ea869e7b42
|
|
@ -7,7 +7,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
@interface GiGaHelper : NSObject
|
@interface GiGaHelper : NSObject
|
||||||
/**
|
/**
|
||||||
* 获取当前时间 格式 yyyy-MM-dd hh:mm:ss
|
* 获取当前时间 格式 yyyy-MM-dd hh:mm:ss
|
||||||
|
|
@ -70,4 +70,6 @@
|
||||||
|
|
||||||
+(NSString*)dictionaryToJson:(NSDictionary *)dic;
|
+(NSString*)dictionaryToJson:(NSDictionary *)dic;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "GiGaHelper.h"
|
#import "GiGaHelper.h"
|
||||||
|
#import <Photos/Photos.h>
|
||||||
@implementation GiGaHelper
|
@implementation GiGaHelper
|
||||||
|
|
||||||
+(NSString *) getNowTimeString{
|
+(NSString *) getNowTimeString{
|
||||||
|
|
@ -294,4 +294,5 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@
|
||||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||||
|
|
||||||
if (buttonIndex == 0) {
|
if (buttonIndex == 0) {
|
||||||
[self satartCamera];
|
[self digPhotoAuth];
|
||||||
}else if (buttonIndex == 1){
|
}else if (buttonIndex == 1){
|
||||||
[self fromAlbums];
|
[self fromAlbums];
|
||||||
}
|
}
|
||||||
|
|
@ -390,6 +390,7 @@
|
||||||
|
|
||||||
-(void)satartCamera{
|
-(void)satartCamera{
|
||||||
|
|
||||||
|
|
||||||
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
||||||
if ((cell.images.count + 1) > 6) {
|
if ((cell.images.count + 1) > 6) {
|
||||||
GIGA_ShowToast(@"最多六张");
|
GIGA_ShowToast(@"最多六张");
|
||||||
|
|
@ -432,6 +433,47 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)digPhotoAuth{
|
||||||
|
|
||||||
|
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
|
||||||
|
|
||||||
|
switch (status) {
|
||||||
|
|
||||||
|
case PHAuthorizationStatusNotDetermined:
|
||||||
|
{
|
||||||
|
NSLog(@"用户还没有做出选择");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PHAuthorizationStatusAuthorized:
|
||||||
|
{
|
||||||
|
|
||||||
|
NSLog(@"用户允许当前应用访问相册");
|
||||||
|
// 拍照后本app需保存到相册
|
||||||
|
[self satartCamera];
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PHAuthorizationStatusDenied:
|
||||||
|
{
|
||||||
|
//NSLog(@"用户拒绝当前应用访问相册,我们需要提醒用户打开访问开关");
|
||||||
|
GIGA_ShowToast(@"拒绝当前应用访问相册,请在系统设置中允许访问");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PHAuthorizationStatusRestricted:
|
||||||
|
{
|
||||||
|
NSLog(@"家长控制,不允许访问");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
NSLog(@"default");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
|
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
|
||||||
[picker dismissViewControllerAnimated:YES completion:nil];
|
[picker dismissViewControllerAnimated:YES completion:nil];
|
||||||
|
|
@ -439,6 +481,7 @@
|
||||||
|
|
||||||
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info
|
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info
|
||||||
{
|
{
|
||||||
|
|
||||||
[picker dismissViewControllerAnimated:YES completion:nil];
|
[picker dismissViewControllerAnimated:YES completion:nil];
|
||||||
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
GIGaFeedPhontosViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue