feat: 添加 iOS 快捷指令(App Intents)及 URL Scheme 支持#876
Open
zeke-chin wants to merge 2 commits intoxiaoyaocz:masterfrom
Open
feat: 添加 iOS 快捷指令(App Intents)及 URL Scheme 支持#876zeke-chin wants to merge 2 commits intoxiaoyaocz:masterfrom
zeke-chin wants to merge 2 commits intoxiaoyaocz:masterfrom
Conversation
iOS 快捷指令(App Intents,iOS 16+): - 打开直播间:输入直播链接,自动解析并跳转 - 跳转直播间:选择平台 + 房间号,直接跳转 - 注册 Siri 短语:「用 Simple Live 打开直播间」 - 使用 @available 守卫,不影响 iOS 13-15 兼容性 - 通过 FlutterMethodChannel 桥接 Swift → Dart,复用 DeepLinkService simplelive:// URL Scheme(iOS / Android / macOS): - simplelive://open?url=<链接> — 自动识别平台并跳转 - simplelive://room?site=<平台>&roomId=<房间号> — 直接跳转 - 新增 DeepLinkService 处理深度链接(基于 app_links 插件) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
当前已在直播间时,使用 Get.offNamed() 替换当前路由而非 push, 避免旧直播间资源(播放器、弹幕、定时器)未释放和导航栈堆积。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
simplelive://URL Scheme(iOS / Android / macOS),支持通过链接唤起 App 跳转直播间docs/shortcuts/README.mdiOS 快捷指令(App Intents)
在「快捷指令」App 中搜索 "Simple Live" 即可看到两个原生动作:
@available(iOS 16, *)守卫,不影响 iOS 13-15 兼容性URL Scheme
支持平台:bilibili / douyu / huya / douyin
调用链路
核心逻辑复用了现有的
ParseController.parse()链接解析和AppNavigator.toLiveRoomDetail()房间跳转能力,不涉及重复实现:App Intents 路径(iOS 16+):
URL Scheme 路径(iOS / Android / macOS):
变更文件
新增:
ios/Runner/AppIntents/— 5 个 Swift 文件(Bridge、2 个 Intent、枚举、ShortcutsProvider)lib/services/app_intent_service.dart— Dart 侧 MethodChannel 服务lib/services/deep_link_service.dart— 深度链接处理服务docs/shortcuts/README.md— 使用文档修改:
ios/Runner/AppDelegate.swift— 初始化 AppIntentBridge + updateAppShortcutParametersios/Runner/Info.plist— 注册simplelive://URL Schemeandroid/app/src/main/AndroidManifest.xml— 注册simplelive://intent-filtermacos/Runner/Info.plist— 注册simplelive://URL Schemelib/main.dart— 注册 DeepLinkService + AppIntentServicepubspec.yaml— 添加app_links依赖Test plan
🤖 Generated with Claude Code