Skip to content

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

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).

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions