camera - How to dismiss imagePicker when user don't allow access in iOS -


i checking camera , photo permission on app when user select or capture image. using code.

-(void)choosephotofromexistingimages  {        alauthorizationstatus status = [alassetslibrary authorizationstatus];     if (status == alauthorizationstatusdenied  || status == alauthorizationstatusrestricted) {         [appdelegate showalertviewforphotos];         //show alert asking user give permission         }     else{         if ([uiimagepickercontroller issourcetypeavailable: uiimagepickercontrollersourcetypephotolibrary])         {             uiimagepickercontroller *controller = [[uiimagepickercontroller alloc] init];             controller.sourcetype = uiimagepickercontrollersourcetypesavedphotosalbum;             controller.allowsediting = yes;             controller.mediatypes = [[nsarray alloc] initwithobjects: (nsstring *) kuttypeimage, nil] ;             controller.delegate = self;             [self presentviewcontroller: controller animated: yes completion: nil];         }     }    } 

the code working fine when user first time choose don't allow photo library display black screen same thing happening in camera. need when user press on don't allow can check user has cancel permission can dismiss imagepicker or camera .enter image description here

you can use alassetslibrary authorizationstatus check it

how react user choosing "don't allow" when asking permission access photos?


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -