From 0251b6e123e17b974d8dd19a5da31fff11d0920a Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Mon, 4 Dec 2017 16:07:02 +0100 Subject: [PATCH] [Camera permission] chech camera's permission on picture button on chat + update translation ressources for new alertview --- Classes/ImagePickerView.m | 9 +++++++-- Resources/ar.lproj/Localizable.strings | Bin 60792 -> 61264 bytes Resources/de.lproj/Localizable.strings | Bin 66400 -> 66870 bytes Resources/en.lproj/Localizable.strings | Bin 63890 -> 64360 bytes Resources/fr.lproj/Localizable.strings | Bin 65962 -> 66488 bytes Resources/ja.lproj/Localizable.strings | Bin 59726 -> 60196 bytes Resources/nl.lproj/Localizable.strings | Bin 63964 -> 64434 bytes Resources/ru.lproj/Localizable.strings | Bin 63410 -> 63880 bytes Resources/zh_TW.lproj/Localizable.strings | Bin 56706 -> 57176 bytes 9 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Classes/ImagePickerView.m b/Classes/ImagePickerView.m index 7f8fa79e8..5d9398a02 100644 --- a/Classes/ImagePickerView.m +++ b/Classes/ImagePickerView.m @@ -18,7 +18,8 @@ */ #import - +#import +#import #import "ImagePickerView.h" #import "PhoneMainView.h" @@ -226,7 +227,11 @@ static UICompositeViewDescription *compositeDescription = nil; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [sheet addButtonWithTitle:NSLocalizedString(@"Camera", nil) block:^() { - block(UIImagePickerControllerSourceTypeCamera); + if([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusAuthorized ){ + block(UIImagePickerControllerSourceTypeCamera); + }else{ + [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Camera's permission", nil) message:NSLocalizedString(@"Camera not authorized", nil) delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Continue", nil] show]; + } }]; } if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { diff --git a/Resources/ar.lproj/Localizable.strings b/Resources/ar.lproj/Localizable.strings index 1296a9a45c0f14e945199347fee055618f5bdb74..d40b2d25291439b885177404bb0c3918a9b759e9 100644 GIT binary patch delta 287 zcmexyi}}Jm<_!*#fw>H+3`Goy4C)NU3j>yRl5-jyFl?p&J@)=5iCL}VH0_hAOuLx*%70|8}B-0%kl7TQ4Y_kGTT|Q7p zGLnr7U{~QcO%JFifFTEHN}?Rlpj05Y6zHiGpfM$2UMAQfKyOX9KOxQx^z`KU?c&VV U3|x}~HNz(xD6njHk~F&l0AqbSH2?qr delta 14 Wcmca`kNL+f<_!*#nrm<}>6mC;`Q7fmn&bnIRD< z2U3y9fJ6P{LWy{gd7KJBo%swU3<{I^8$`JgW;jkRd?hTMjAW7m*ftdPlhY0fiI)Oh ylLAy%0<;mN251(@J(Cx=dI13UJTc7x delta 14 Vcmdni#qywyWdob^<~uS`F90uJ25kTU diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 2154467a9b397cc1617197233ede16f7ed315270..2003a286646494989ea90dd7391c26787f57ef3e 100644 GIT binary patch delta 208 zcmbRAnfb*x<_)tXCo4#DIIA-hGbk_=Fr+dRG2}920(r$iGM^!jK?x{s3&ctc&J2k_ zIgpA(1}y3)GiJt57LZ~Ana8OB)S1sv!k{pju}qX3VTR-6z$?Pi$w($CfNeujKe=eN uka#K3H7P)KB|sZNYJg^e+%wtnh&VIQ_Q`>E!jm0ZqJTECZJs0f?LGjxqc7+H delta 14 WcmaFyjd{{%<_)tXHy23%xDNn3>IdQg diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index 6e4d4297bdc216ef33e3ba33ec5cc6ff3d9bf499..c60bc99ce89089278dd36f28cb796a886f758b33 100644 GIT binary patch delta 236 zcmZ40%(A1MWrK$F!%+OQ-s?KL90jf=8Cc|1= zQD8_0lDP~ofx1AvGN4|NZ2n|^R&h>}L<8HyMZ8Ppky859@_z`R_BOdziqNai!-O)iua7sV<&`Qzf) z$sZ(GcwuHJFyt}hPiA~5Zl1!R1T@VSh?N)|8Ipl86>OpcLkZAK1t33>0ig?I8(iQ^M+fJlM^I4gw+{}859@_7*ZLE7;+ghfxP0$imJl0i9jAmERg}53i)aA zlLMq!Kqk~HFyt}hGn4>LNn|Jm(iuQr5zwS6p#BsFC7`%15Gye_G9&|GD#!*PzXYgC z0mw(#qX4!YziE0vJpl|kKvNQdrlbOSrD8zGrvSMnU~VSZA^8k>lLg<2GXtGI`Ju4z RWShxRKR?`xC;O}IS2Uw diff --git a/Resources/zh_TW.lproj/Localizable.strings b/Resources/zh_TW.lproj/Localizable.strings index 83afe228731bd6167ae292757022acb3c1b72d82..d7bcef89c78521f54fbd0e726d56e08ad46751a7 100644 GIT binary patch delta 254 zcmZqL&3t1Y^9Bxa?_7pdh9ZVU26cvF1_g!!FfW%O6UZwDlKBjI3`#(8TOd|qa0aTw zqki()JMohzi1B1A0CnXvlmPW4GL!=83?Q!vXj&D}^b{oX92t^4`JyyR5WWCbyn%^c!Y F#{ky