fix: extension install by deeplink (#1510)

This commit is contained in:
Levi authored and GitHub committed 2026-09-13 23:40:59 +08:00
1 parent a760290213
commit cee5f3336e
36 files changed
+869 -143

No files matched your search

+3
View File
@@ -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>
+21
View File
@@ -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)
}
}
}