提交 a87d15d6 编写于 作者: S Sarah Zakarias 提交者: GitHub

Send AppLifecycleState notifications on FlutterViewController lifecycle events. (#3801)

上级 a08f52ed
......@@ -323,7 +323,7 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) {
activity_running_ = false;
StopAnimator();
} else if (state == "AppLifecycleState.resumed" ||
state == "AppLifecycle.inactive") {
state == "AppLifecycleState.inactive") {
activity_running_ = true;
StartAnimatorIfPossible();
}
......
......@@ -273,11 +273,19 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse {
[view release];
}
#pragma mark - UIViewController lifecycle notifications
- (void)viewWillAppear:(BOOL)animated {
[self connectToEngineAndLoad];
[super viewWillAppear:animated];
}
- (void)viewDidDisappear:(BOOL)animated {
[_lifecycleChannel.get() sendMessage:@"AppLifecycleState.paused"];
[super viewDidDisappear];
}
#pragma mark - Application lifecycle notifications
- (void)applicationBecameActive:(NSNotification*)notification {
......@@ -533,6 +541,7 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase(UITouc
[self surfaceUpdated:YES];
[self onLocaleUpdated:nil];
[self onVoiceOverChanged:nil];
[_lifecycleChannel.get() sendMessage:@"AppLifecycleState.resumed"];
[super viewDidAppear:animated];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册