2

How can I use UIDocumentPickerViewController to let the user select a folder from their Dropbox?

If I call this, I can browse for folders, but the Dropbox folder is greyed out:

[[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[(__bridge NSString*)kUTTypeFolder]
                                                       inMode:UIDocumentPickerModeOpen];

If I change the mode to UIDocumentPickerModeImport, I get an Assertion failure and it crashes. It seems that Import doesn't work together with kUTTypeFolder. If I keep Import and set the types to @[kUTTypeFolder, kUTTypeImage], I get access to the Dropbox, but the picker only lets me select images, not folders.

Any help or advice would be appreciated!

Nick
  • 875
  • 6
  • 20
basteln
  • 2,483
  • 2
  • 19
  • 20

1 Answers1

2

The Dropbox iOS app document picker doesn't support opening folders, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

Greg
  • 16,359
  • 2
  • 34
  • 44
  • Thanks Greg! It would be really useful for importing a lot of files at once. – basteln Dec 17 '19 at 07:58
  • Hi Greg, any change in 2021? Or should I go for Dropbox API if I need folder access? – Ivan Mir Feb 11 '21 at 23:46
  • 1
    @IvanMir I don't have an update on this request unfortunately, so I do recommend using the API if the current doc picker support doesn't satisfy your use case. – Greg Feb 12 '21 at 14:54