6

I have an iOS app where I present an image picker the

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

self.popover = [[UIPopoverController alloc] initWithContentViewController:self.picker];
[self.popover presentPopoverFromRect:CGRectMake(100, 100, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

The app however doesn't ask for permissions at all, it just displays the error message "This app does not have access to your photos or videos".

Any ideas on what might cause this?

Thanks in advance!

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

5

The issue was the the Bundle Display Name wasn't set in the Info.plist

0

in iOS 9, UIPopoverController is deprecated and why don't you use presentViewController instead.

Alex
  • 616
  • 4
  • 11
  • I tried this too: https://gist.github.com/iliketosneeze/e7b012f260953db5667c but I get the same issue – nitrogenhurricane Oct 08 '15 at 08:22
  • You can try to use Full Screen style, not popover, I am not sure why you are going to use popover. – Alex Oct 08 '15 at 08:28
  • If I use full screen I just get a black screen. The code only doesn't seem to work on iPads on iOS 9. On other devices and versions it works. – nitrogenhurricane Oct 08 '15 at 08:31
  • Try to check [ALAssetsLibrary authorizationStatus] and check what the result value is, Also try to add NSPhotoLibraryUsageDescription key in info.plist – Alex Oct 08 '15 at 08:34
  • ALAssetsLibrary seems to be deprecated too, I even get an undeclared identifier error. I do have NSPhotoLibraryUsageDescription already in the info.plist. – nitrogenhurricane Oct 08 '15 at 08:38