问题
Steps to reproduce:
- Create a new project with default settings in Xcode 11: Single View App / Swift / Storyboards.
- Add your Document Types and Imported UTIs.
Result: My application appears in “Copy to...” menu (or “Open in...” if we use LSSupportsOpeningDocumentsInPlace).
It really launches the app.
But this delegate method: application(_:url:options:) is never called.
回答1:
In iOS 13 this method was replaced with a new UISceneDelegate method by default.
Solution:
If you don't need scenes, just remove all scene-related code: SceneDelegate etc., remove UIApplicationSceneManifest from Info.plist, and add var window: UIWindow? to your AppDelegate.
application(_:url:options:) is working now.
来源:https://stackoverflow.com/questions/58624477/application-urloptions-is-never-called