Skip to content

Scene delegate migration#755

Merged
JarvanMo merged 6 commits into
mainfrom
scene-delegate-migration
May 6, 2026
Merged

Scene delegate migration#755
JarvanMo merged 6 commits into
mainfrom
scene-delegate-migration

Conversation

@JarvanMo

@JarvanMo JarvanMo commented May 6, 2026

Copy link
Copy Markdown
Member

No description provided.

@JarvanMo
JarvanMo merged commit f555f77 into main May 6, 2026
4 checks passed
@JarvanMo
JarvanMo deleted the scene-delegate-migration branch May 6, 2026 08:24
JarvanMo pushed a commit that referenced this pull request Jul 20, 2026
## 问题说明

iOS App 使用 `FlutterSceneDelegate` 时,通过微信开放标签 `wx-open-launch-app` 冷启动
App,自定义微信 URL Scheme 会通过 `UISceneConnectionOptions.urlContexts` 传入。

fluwx 当前处理了 `UIApplicationDelegate.application:openURL:options:`,但没有处理
UIScene 对应的冷启动入口,导致:

- 微信可以成功冷启动 App;
- `registerApi()` 正常返回 `true`;
- Dart subscriber 无法收到 `WeChatLaunchFromWXRequest`;
- 无法获取开放标签传入的 `extMsg`。

## 修改内容

- 将现有 URL Scheme 处理和缓存逻辑抽取为 `handleOrCacheOpenURL:`;
- 新增 `scene:openURLContexts:`,处理 App 运行期间收到的自定义 URL Scheme;
- 新增 `scene:willConnectToSession:options:`,处理冷启动时
`connectionOptions.URLContexts` 中的 URL;
- 复用现有 `_cachedOpenUrlRequest` 和 `attemptToResumeMsgFromWx()` 流程;
- 不修改现有 Dart API 和 Android 行为。

## 测试结果

已在 iOS 真机 Profile 模式下测试:

1. 完全结束 App;
2. 通过微信开放标签冷启动;
3. `registerApi()` 返回 `true`;
4. Dart subscriber 收到 `WeChatLaunchFromWXRequest`;
5. 成功获取 `extMsg`;
6. App 成功跳转到指定业务页面。

## 关联问题

Fixes #769  
Related to #733  
Follow-up to #755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant