Document importing from Apple Mail fails on iOS / iPadOS 15.5 when local storage is set to "On My iPhone / iPad"

Originator:appsolutelyfun
Number:rdar://FB10038598 Date Originated:June 5, 2022
Status:open Resolved:
Product:iOS Product Version:15.5
Classification:UIKit Reproducible:yes
 
How to duplicate the issue:

(1) On a device running iOS 15.5 or iPadOS 15.5, try opening an attachment via Apple Mail whose document type is a custom type (whose app is installed on the device).

(2) If the app's Document Storage setting in the Settings app is set to local storage ("On My iPad" or "On My iPhone"), the document fails to be imported into the app.  Any call to the UIDocumentBrowserViewController's revealDocument(at:importIfNeeded:completion:) method [initiated from either the appDelegate's application(_:open:options:) method or the sceneDelegate's scene(_:openURLContexts:) method] returns nil for both parameters of the completion handler, the error parameter and the revealedDocumentURL parameter.  In addition, the UIDocumentBrowserViewController's documentBrowser(_:failedToImportDocumentAt:error:) method is called, but returns nil for its error.  

What should happen instead:  
the Mail attachment *should* be imported into its app.

An additional piece of info: if the app's Document Storage setting in the Settings app is instead set to "iCloud Drive," the Mail attachment *is* properly imported.


The issue can be duplicated using Apple's own UIDocumentBrowserViewController "Particles" app sample code (downloaded from https://developer.apple.com/documentation/uikit/view_controllers/building_a_document_browser_app_for_custom_file_formats), unmodified.

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!