What method is the Files app calling?

If I click on a file icon inside the Files app, it opens the app associated with that file type (so if I click on a text file, it opens the app associated with text files).


The question is: *what* method of this app is it calling?

According to breakpoints I have placed in my apps, it is not:

application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)

and it is not:

application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:], completionHandler: ((Bool) -> Void)? = nil)

Both of which were my main guesses.

It does call the app, because the app moves to the foreground. But with which method?

HI,


it will call didFinishLaunchingWithOption if app is not opened on background, openUrl otherwise.


I managed to make my app got opened/restored with these methods, but when the file is from other apps Documents (iClouds, etc), when i try to read the file from the URL, i can't as my app does not have permission to read it. When it is on my app's Documents, it works. Do you have any idea how to handle it? The main reason to support Files app was to access the files from iCloud drive.


Thanks!

What method is the Files app calling?
 
 
Q