Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App does not have access to your photos or videos iOS 9

Tags:

When I access my Photo Library with an UIImagePicker to choose a photo, the app shows me sometimes a black screen and sometimes a screen that says that I have to give permissions to my app to access the photos. But when I go to Settings -> Privacy -> Photos, there’s no app there and the app is nowhere to be seen in Settings. I read that I must add two values to my Info.plist but they didn’t worked either. Have anyone run with the same error? I’m working with xcode 7, swift 2.0 and iOS 9

enter image description here

This is where i prompt for user for Camera access

@IBAction func cameraButtonPressed(sender: UIButton) {      let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: UIAlertControllerStyle.ActionSheet)      let cancelAction = UIAlertAction(title: "Cancel", style: .Default) { (UIAlertAction) -> Void in         self.dismissViewControllerAnimated(true, completion: nil)     }      let cameraAction = UIAlertAction(title: "Take Photo", style: .Default) { (UIAlertAction) -> Void in         if UIImagePickerController.availableCaptureModesForCameraDevice(.Rear) != nil {             self.imagePicker.allowsEditing = false             self.imagePicker.sourceType = UIImagePickerControllerSourceType.Camera             self.imagePicker.cameraCaptureMode = .Photo             self.presentViewController(self.imagePicker, animated: true, completion: nil)         } else {             self.noCamera()         }     }      let photoLibraryAction = UIAlertAction(title: "Photo Library", style: .Default) { (UIAlertAction) -> Void in         self.imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary         self.presentViewController(self.imagePicker, animated: true, completion: nil)     }      actionSheet.addAction(photoLibraryAction)     actionSheet.addAction(cameraAction)     actionSheet.addAction(cancelAction)      self.presentViewController(actionSheet, animated: true, completion: nil)  } 
like image 449
Manuel Munoz Avatar asked Sep 24 '15 18:09

Manuel Munoz


People also ask

When iPhone won't allow apps access to your Photos?

Go to Settings-->>Privacy-->>Camera and turn the settings to ON for each app that you would like to have access to it. Go to Settings-->>Privacy-->>Photos and make sure that those apps have the Read & Write permissions.

How do I give an app permission to access my iPhone Camera?

Option 2: Manage app's privacy permission With this option, you can easily manage which app can access the camera. Step 1: Go to Settings > Privacy. Step 2: Tap on Camera to see which apps have access to it. You can allow or block apps using Camera from here.

How do I enable photo permissions on iPhone?

On your iPhone or iPad, open Settings. Tap Photos. Select a permission option.


2 Answers

This issue appear in iOS 9 when your application Info.plist file contains a key: "CFBundleDisplayName" with empty string value.

You can enter your app name there and it should work.

like image 51
Vijay D. Gupta Avatar answered Sep 25 '22 18:09

Vijay D. Gupta


In info.plist, "Bundle display name" field can not be empty.

Example

like image 24
Pham Ngoc Quynh Avatar answered Sep 21 '22 18:09

Pham Ngoc Quynh