How to get multiple files shared from Files app in my iOS app?

The scene(_:openURLContexts:) in UISceneDelegate called by iOS only with the first shared file URL in its's URLContexts: Set<UIOpenURLContext> parameter.

How can I get the full file URLs shared from other app?

Can you provide a bit more information on what you're doing to try and open multiple URLs from Files?

Note that today, open URL requests are generally atomic operations and do not (yet) transfer multiple URLS. The set of URL contexts in the UISceneDelegate was designed to match the existing pattern of other callbacks and to allow for multiple files in the future.

I found that some apps I installed from AppStore can import multiple files by Share extension or Action extension. But since I need to access CoreData database, I think it will be better to just open my main app to handle file importing.

I am also having the same issue. Here is how I am trying to import multiple URLs from Files: I go to the Files app, select the folder in iCloud Drive, click the "3 dots in a circle" icon in the top right corner, choose "Select" from the menu, select several files, click the share icon in the lower left corner and then choose my app icon. My app gets launched, but "scene:openURLContexts:" is called only once with an array of contexts containing only the first file.

I have a couple hundred files in a folder on my iCloud Drive, and I want to import all or many of them into my app (as I understand my app is not able to access the iCloud folder contents directly). It is going to be incredibly tedious if users need to import files one at a time. Is there any way I can import multiple files in a single operation in iOS 13 to 15.4, or do I really need to wait until Apple releases an update to "allow multiple files in the future"?

How to get multiple files shared from Files app in my iOS app?
 
 
Q