Remove lifecycle callbacks with UIApplication lifecycle notification in iOS.#10253
Remove lifecycle callbacks with UIApplication lifecycle notification in iOS.#10253loongliu wants to merge 1 commit intoflutter:masterfrom loongliu:ios_life_cycle
Conversation
… in iOS. When use flutter with `add2app`, Flutter's lifecycle is not same with application's lifecycle. When FlutterViewController is cover by another native UIViewController using `add2app`, Flutter's rendering pipeline is stopped by FlutterViewController's `viewWillDisappear`. When application resigned active and then becomes active, FlutterViewController will notify engine to resume rendering pipeline, while FlutterView is not visible. To correct this, we should make Flutter's lifecycle same as FlutterViewController's lifecycle.
dnfield
left a comment
There was a problem hiding this comment.
This will break "regular flutter apps, and will need some tests.
This is a challenging problem too. I'm not sure of the best way to resolve it. May e some parameter or property on the viewcontoller about whether it needs these hooks?
|
Thanks for your contribution! Given that a fair bit of functionality/existing apps depend on these, this would be a significant breaking change. Since we don't plan to merge this change; I'll close this PR. The good news is that @gaaclarke is working on resolving the lifecycle issues for add2app, which should resolved the underlying issue either way. |
|
I have the same issue, when i open another native controller in flutter app, the application change to AppLifecycleState.inactive then AppLifecycleState.paused. My flutter app using WebSocket and i will disconnect when application enter background (paused triggered), but when i open native controller flutter call AppLifecycleState.paused and i expect socket keeping connection but websocket was closed. |
When use flutter with
add2app, Flutter's lifecycle is not same with application's lifecycle. When FlutterViewController is cover by another native UIViewController usingadd2app, Flutter's rendering pipeline is stopped by FlutterViewController'sviewWillDisappear. When application resigned active and then becomes active, FlutterViewController will notify engine to resume rendering pipeline, while FlutterView is not visible.To correct this, we should make Flutter's lifecycle same as FlutterViewController's lifecycle.