Skip to content

Add UIScene requirements for iOS add-2-app docs#13279

Open
sfshaza2 wants to merge 4 commits intomainfrom
fix-13274
Open

Add UIScene requirements for iOS add-2-app docs#13279
sfshaza2 wants to merge 4 commits intomainfrom
fix-13274

Conversation

@sfshaza2
Copy link
Copy Markdown
Contributor

Fixes #13274

@sfshaza2 sfshaza2 requested a review from a team as a code owner April 15, 2026 22:20
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates iOS documentation and code examples to support the UISceneDelegate lifecycle. It introduces FlutterSceneDelegate for handling scene callbacks and FlutterImplicitEngineDelegate to safely initialize plugins and platform channels when the application window is not yet available. Feedback was provided to correct parameter types in the Objective-C implementation of the FlutterSceneLifeCycleProvider protocol to ensure consistency and avoid potential compiler warnings.

+ return self;
+ }
+
+ - (void)addSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter type for addSceneLifeCycleDelegate should match the FlutterSceneLifeCycleProvider protocol definition, which uses id<FlutterSceneLifeCycleDelegate> (or NSObject<FlutterSceneLifeCycleDelegate>*). Using NSObject<FlutterPlugin>* is unnecessarily restrictive and may cause compiler warnings or errors due to a signature mismatch with the protocol.

Suggested change
+ - (void)addSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate {
- (void)addSceneLifeCycleDelegate:(id<FlutterSceneLifeCycleDelegate>)delegate {

+ [_sceneLifeCycleDelegate addDelegate:delegate];
+ }
+
+ - (void)removeSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter type for removeSceneLifeCycleDelegate should match the FlutterSceneLifeCycleProvider protocol definition, which uses id<FlutterSceneLifeCycleDelegate> (or NSObject<FlutterSceneLifeCycleDelegate>*).

Suggested change
+ - (void)removeSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate {
- (void)removeSceneLifeCycleDelegate:(id<FlutterSceneLifeCycleDelegate>)delegate {

@flutter-website-bot
Copy link
Copy Markdown
Collaborator

Visit the preview URL for this PR (updated for commit b468174):

https://flutter-docs-prod--pr13279-fix-13274-3veb4wou.web.app

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.

iOS Add to App docs should include UIScene migration requirements

2 participants