From dd789a5ed6f3ae5a3acbcfb822a9392e83f04af6 Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Tue, 5 Dec 2017 10:55:44 +0100 Subject: [PATCH] [Chat perm] add alertView on chat add picture from library if no permission --- Classes/ImagePickerView.m | 7 ++++++- Resources/ar.lproj/Localizable.strings | Bin 61264 -> 61756 bytes Resources/de.lproj/Localizable.strings | Bin 66870 -> 67364 bytes Resources/en.lproj/Localizable.strings | Bin 64360 -> 64854 bytes Resources/fr.lproj/Localizable.strings | Bin 66488 -> 67050 bytes Resources/ja.lproj/Localizable.strings | Bin 60196 -> 60690 bytes Resources/nl.lproj/Localizable.strings | Bin 64434 -> 64928 bytes Resources/ru.lproj/Localizable.strings | Bin 63880 -> 64374 bytes Resources/zh_TW.lproj/Localizable.strings | Bin 57176 -> 57670 bytes 9 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Classes/ImagePickerView.m b/Classes/ImagePickerView.m index 5d9398a02..cacd57211 100644 --- a/Classes/ImagePickerView.m +++ b/Classes/ImagePickerView.m @@ -20,6 +20,7 @@ #import #import #import +#import #import "ImagePickerView.h" #import "PhoneMainView.h" @@ -237,7 +238,11 @@ static UICompositeViewDescription *compositeDescription = nil; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { [sheet addButtonWithTitle:NSLocalizedString(@"Photo library", nil) block:^() { - block(UIImagePickerControllerSourceTypePhotoLibrary); + if([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized ){ + block(UIImagePickerControllerSourceTypePhotoLibrary); + }else{ + [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Camera's permission", nil) message:NSLocalizedString(@"Camera not authorized", nil) delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Continue", nil] show]; + } }]; } [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:nil]; diff --git a/Resources/ar.lproj/Localizable.strings b/Resources/ar.lproj/Localizable.strings index d40b2d25291439b885177404bb0c3918a9b759e9..51afad6ca4ecb903a4e97bd84324c2ab6ceb004d 100644 GIT binary patch delta 66 zcmca`k9p4{<_(9WCi}1iOg>Q0HQ7T_1xQOxu8=GO(mc$04Ed8U-VmQGB&7frx07lC Ot9>BDwpmKr>Q2Wy1}b$#rdP%q0x@lX<08C--znO}3LRf{X2zwgri?DllX+6i?nQEx%bq HhVLZ+o=Ft~ delta 18 acmZ3|$Fi-9Wy1}b$pTU=n@`C_y#N47Xa~Ij diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 2003a286646494989ea90dd7391c26787f57ef3e..bf88909cfea8d92f8cdfba34ab565b1cb3741aa2 100644 GIT binary patch delta 62 zcmaFyjrrOy<_$U0oB<3O4EYQt4Ed86N~%tNRwXt0l4KE*sK1o$HwN2`P;$4Cin J-Xpc<0RZXU7z6+S delta 17 Zcmccii}}Sj<_$U0la$ytC&+%g4**f*2&(`9 diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index c60bc99ce89089278dd36f28cb796a886f758b33..1745d8bbd1040c751cac6e4573f80d2437e3ccd9 100644 GIT binary patch delta 104 zcmdnd&ho08WrLCIRdJ|eP+%wk>H_J_XW-myFH`v(07lpyJOBUy delta 18 acmaFW&9bANWrLCIo3rE_o&f+%c?b3Y diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings index 82c5ffced0b6e453b9a5984fb40104e150f32e48..579badcd689f8716aeb02adc49b55f9fc1d61fb1 100644 GIT binary patch delta 54 zcmZ2-jd{{7<_$}vCM#62F_$ppPrfOk$`~-&QAu(#mt+xKv|Z8`BD(p4WXMGT3BwXk delta 18 acmbPqi+Ra4<_$}vCOgQnZJr@hbpZfQ-v|Q$ diff --git a/Resources/nl.lproj/Localizable.strings b/Resources/nl.lproj/Localizable.strings index 5a7f11a34541c51e194bc3548cb02b5e8c133e7d..ffeb605ee71c19c8e1d2d0d8cfd543f75117a14c 100644 GIT binary patch delta 94 zcmdn=oq54;<_+7VC;K(AF_$ppPkt?_DjC3#!H~}Y3;e^M*CjoB<3O4EYQt4Ed8EN~%si)Fd@oNU8`)v|q{=B+9D5kjYRyxnD|t J^B<|6djRht7T5p) delta 18 acmezNjk)79^M*CjlNTtkZC)UI?JfXZ4GCcY diff --git a/Resources/zh_TW.lproj/Localizable.strings b/Resources/zh_TW.lproj/Localizable.strings index d7bcef89c78521f54fbd0e726d56e08ad46751a7..f0e67aa582bcea6204c8ab1d707a4764a3aea78a 100644 GIT binary patch delta 58 zcmcbykNMak<_)(bCQm3}n;cNYGFd=eWwKY1)MN+oBB&VK