Why Photos app is NOT showing in the Document Provider extensions on the device?

2.1k Views Asked by At

I'm working in app to pick photo, I have used UIDocumentMenuViewController to display list of extensions for document provider. This list shows Dropbox, iCloud, GoogleDrive but not the native Photos app, why? Sample of my code:

UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport];

enter image description here

1

There are 1 best solutions below

4
Hossam Ghareeb On

I'm not sure if there is another way natively to do this, but I came up with a solution to add a custom option with handler. I added "Photos" option and in the handler I use UIImagePickerViewController:

 UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:UTIs inMode:UIDocumentPickerModeImport];


    [menuVC addOptionWithTitle:@"Photos" image:nil order:UIDocumentMenuOrderFirst handler:^{

        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

        imagePickerController.delegate = self;
        [self presentViewController:imagePickerController animated:YES completion:nil];
    }];

I will do the same and add another option for "Camera".