Skip to content

[UIScene] SceneLifeCycle API to register/unregister the engine can be error prone #185689

Closed

Description

@hellohuanlin

From our migration guide: https://docs.flutter.dev/release/breaking-changes/uiscenedelegate#if-your-app-supports-multiple-scenes

If you manually register a FlutterEngine with a scene, you must also unregister it if the view created by the FlutterEngine changes scenes.

// If using FlutterSceneDelegate:
self.unregisterSceneLifeCycle(with: flutterEngine)

// If using FlutterSceneLifeCycleProvider:
sceneLifeCycleDelegate.unregisterSceneLifeCycle(with: flutterEngine)

Issues:

  1. It's unclear where to call unregister in the doc (so we should polish the doc)
  2. This API can be error prone - developers could easily forget to call register/unregister (especially unregister).

Activity

  1. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Apr 30, 2026
  2. hellohuanlin commented on Sep 9, 2026

    @hellohuanlin
    ContributorAuthor

    It turns out that we still have to have register/unregister APIs, but we only need it for edge cases when Flutter VC is not added on the screen.

    Also we should add a scene parameter, since one UISceneDelegate could power multiple UIScenes.

  3. github-actions commented on Oct 30, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions