mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 11:53:41 +00:00
fix: extension install by deeplink (#1510)
This commit is contained in:
36 files changed
+869
-143
No files matched your search
@@ -24,6 +24,9 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<!-- app_links owns scheme navigation for both task creation and extension installation. -->
|
||||
<key>FlutterDeepLinkingEnabled</key>
|
||||
<false/>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import app_links
|
||||
|
||||
class SceneDelegate: FlutterSceneDelegate {
|
||||
override func scene(
|
||||
_ scene: UIScene,
|
||||
willConnectTo session: UISceneSession,
|
||||
options connectionOptions: UIScene.ConnectionOptions
|
||||
) {
|
||||
super.scene(scene, willConnectTo: session, options: connectionOptions)
|
||||
forwardGopeedLinks(connectionOptions.urlContexts)
|
||||
}
|
||||
|
||||
override func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
|
||||
super.scene(scene, openURLContexts: URLContexts)
|
||||
forwardGopeedLinks(URLContexts)
|
||||
}
|
||||
|
||||
private func forwardGopeedLinks(_ contexts: Set<UIOpenURLContext>) {
|
||||
// app_links 6.x only registers AppDelegate callbacks. UIScene delivers
|
||||
// both cold-start and running-app scheme links here instead.
|
||||
for context in contexts where context.url.scheme?.lowercased() == "gopeed" {
|
||||
AppLinks.shared.handleLink(url: context.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user