[quick_actions_ios] UIScene Migration#11047
[quick_actions_ios] UIScene Migration#11047okorohelijah wants to merge 9 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the quick_actions_ios plugin to support the UIScene lifecycle, which is necessary for modern iOS apps. The changes involve conforming to FlutterSceneLifeCycleDelegate, implementing new lifecycle methods for scenes, and updating the example app to enable scene support. New tests for the scene-based lifecycle have also been added. My review focuses on ensuring the new lifecycle methods are implemented correctly and that the tests are robust.
...s/quick_actions_ios/ios/quick_actions_ios/Sources/quick_actions_ios/QuickActionsPlugin.swift
Show resolved
Hide resolved
packages/quick_actions/quick_actions_ios/example/ios/RunnerTests/QuickActionsPluginTests.swift
Outdated
Show resolved
Hide resolved
...s/quick_actions_ios/ios/quick_actions_ios/Sources/quick_actions_ios/QuickActionsPlugin.swift
Outdated
Show resolved
Hide resolved
packages/quick_actions/quick_actions_ios/example/ios/RunnerTests/QuickActionsPluginTests.swift
Outdated
Show resolved
Hide resolved
packages/quick_actions/quick_actions_ios/example/ios/RunnerTests/QuickActionsPluginTests.swift
Outdated
Show resolved
Hide resolved
packages/quick_actions/quick_actions_ios/example/ios/RunnerTests/QuickActionsPluginTests.swift
Outdated
Show resolved
Hide resolved
packages/quick_actions/quick_actions_ios/example/ios/RunnerTests/QuickActionsPluginTests.swift
Show resolved
Hide resolved
| options connectionOptions: UIScene.ConnectionOptions? | ||
| ) -> Bool { | ||
| // Handle the case where app is launched via a shortcut item in scene-based lifecycle. | ||
| if let shortcutItem = connectionOptions?.shortcutItem { |
There was a problem hiding this comment.
is this new logic? did we have similar logic in legacy app delegate methods?
There was a problem hiding this comment.
not new but similar to legacy which uses launchOptions[.shortcutItem]
There was a problem hiding this comment.
do we need to remove the legacy code?
|
I'm handing this PR review over to @hellohuanlin, but let me know if any UIScene questions come up |
| windowScene, | ||
| performActionFor: item | ||
| ) { success in | ||
| completionSuccess = success |
There was a problem hiding this comment.
is this closure called synchronously? (is completionSuccess assigned before #expect check below?)
| options connectionOptions: UIScene.ConnectionOptions? | ||
| ) -> Bool { | ||
| // Handle the case where app is launched via a shortcut item in scene-based lifecycle. | ||
| if let shortcutItem = connectionOptions?.shortcutItem { |
There was a problem hiding this comment.
do we need to remove the legacy code?
| return handleSceneWillConnectTo(connectionOptions: connectionOptions) | ||
| } | ||
|
|
||
| func handleSceneWillConnectTo(connectionOptions: ConnectionOptionsProtocol?) -> Bool { |
There was a problem hiding this comment.
is shortcutItem the only property needed in ConnectionOptions? If so, you can just pass in the shortcutItem here, and avoid writing the protocol.
Migrate quick_actions_ios to adopt UIScene
Fixes flutter/flutter#170179
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3