UIDocumentPickerViewController: assert on picking non-file URL

Originator:kenferry
Number:rdar://17429230 Date Originated:6/23/2014
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8
Classification:Other Bug Reproducible:Yes
 
If an app puts up a UIDocumentPickerViewController for document import, and the picker tries to return an http URL as Dropbox is wont to do, like "https://www.dropbox.com/s/97kxdhbu7acbfhx/2014-06-20%2014.24.12.jpg", then UIDocumentPickerViewController asserts:

<Warning>: *** Assertion failure in -[DocumentPickerViewController dismissGrantingAccessToURL:], /SourceCache/UIKit/UIKit-3232.3/UIDocumentPickerExtensionViewController.m:34
<Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Can only grant access to file URLs'

This is not desirable.  My app, http://understudyapp.com, is like FaceTime with a whiteboard. We support dumping a document into the whiteboard, so both people can simultaneously look at it and mark it up.

Prior to iOS 8, we have direct Dropbox integration. Dropbox has a file picker flow where what comes back is an http URL – the file is on Dropbox's servers and can be downloaded. Note that this works just fine for import. 

This is really great for us! Both people in Understudy's chat need the file, and they can both get it, by downloading it from Dropbox. Otherwise we would have to upload it from one to the other, which is possible, but will not perform well, because upload bandwidth is typically saturated by the videochat.

We'd like to get rid of the direct Dropbox integration in iOS 8 in favor of UIDocumentPickerViewController, but it will be a regression for our app if Dropbox cannot hand back a remote http URL from the picker.

Steps to Reproduce:
Attached test project that provides a document picker extension that attempts to return an http URL. 

Run it, use a document picker elsewhere, select the file provided by the "RemoteOnlyPicker". 

Expected Results:
File is selected, document picker dismisses.

Actual Results:
UI goes wonky

Version:
iOS 8 2nd seed, 12A4297e

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!