#include <FlutterSceneLifeCycle.h>
Instance Methods | |
| (BOOL) | - registerSceneLifeCycleWithFlutterEngine: |
| (BOOL) | - unregisterSceneLifeCycleWithFlutterEngine: |
A protocol for manually registering a FlutterEngine to receive scene life cycle events.
Definition at line 104 of file FlutterSceneLifeCycle.h.
| - (BOOL) registerSceneLifeCycleWithFlutterEngine: | (FlutterEngine *) | engine |
Registers a FlutterEngine to receive scene life cycle events.
This method is only necessary when the following conditions are true:
UIWindowSceneDelegate window.rootViewController is not a FlutterViewController initialized with the target FlutterEngine.When multiple scenes is enabled (UIApplicationSupportsMultipleScenes), Flutter cannot automatically associate a FlutterEngine with a scene during the scene connection phase. In order for plugins to receive launch connection information, the FlutterEngine must be manually registered with either the FlutterSceneDelegate or FlutterPluginSceneLifeCycleDelegate during scene:willConnectToSession:options:.
In all other cases, or once the FlutterViewController.view associated with the FlutterEngine is added to the view hierarchy, Flutter will automatically handle registration for scene events.
Manually registered engines must also be manually deregistered and re-registered if they switch scenes. Use unregisterSceneLifeCycleWithFlutterEngine:.
| engine | The FlutterEngine to register for scene life cycle events. |
NO if already manually registered. | - (BOOL) unregisterSceneLifeCycleWithFlutterEngine: | (FlutterEngine *) | engine |
Use this method to unregister a FlutterEngine from the scene's life cycle events.
| engine | The FlutterEngine to unregister for scene life cycle events. |
NO if the engine was not found among the manually registered engines and could not be unregistered.