iOS / Obj-C - Change request access to camera text?

Viewed 258

I submitted my app to the Apple App Store. My app requests permission to access a user's camera roll, and in doing so presents a system generated message that says:

"[App Name] would like to access your camera"

. That said, Apple rejected the app becaues the alert needs to state WHY access is needed and how it will be used by the app.

Having said that, how can I customize the alert message? This message is generated by the system as far as I know, as my code doesn't include it...

ViewController.m

- (IBAction)selectPhoto:(id)sender {


    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = YES;
    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

    [self presentViewController:picker animated:YES completion:NULL];


}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
    self.imageView.image = chosenImage;

    [picker dismissViewControllerAnimated:YES completion:NULL];

}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {

    [picker dismissViewControllerAnimated:YES completion:NULL];

}
1 Answers

AVFoundation Documentation states that you have to add NSCameraUsageDescription in your Info.plist and provide a clear message to explain your users why your app needs to use the camera.

This is actually mandatory and the documentation is clear about that :

Important

If the appropriate key is not present in your app's Info.plist file when your app requests authorization or attempts to use a capture device, the system terminates your app.

Related