Questions tagged «custom-scheme-url»

2
方法'scene(_:openURLContexts :)'未调用
在Info.plist文件我配置URL Identifier和URL Scheme成功。我也可以使用自定义网址打开应用。问题是应用首次启动时的方法 func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) does not call. 我有一些基于上述方法的依赖功能。因此,当应用首次启动时,我无法在应用中看到任何内容。 我也在方法中添加了代码 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let _ = (scene as? UIWindowScene) else { return } let url = connectionOptions.urlContexts.first?.url } 但我在这里得到的网址为nil。 但是,如果我的应用程序处于后台模式并且点击了URL,则上述方法将成功调用并且相关功能可以正常工作。以下是我在中的scene(_:openURLContexts:)方法代码sceneDelegate。 func scene(_ scene: UIScene, openURLContexts URLContexts: …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.