Skip to content

Commit 9223073

Browse files
authored
Fix background crash when FlutterView going appear while app goes background (#23175)
1 parent 3da13fc commit 9223073

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

shell/platform/darwin/ios/framework/Source/FlutterViewController.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,9 @@ - (void)viewDidAppear:(BOOL)animated {
664664
TRACE_EVENT0("flutter", "viewDidAppear");
665665
[self onUserSettingsChanged:nil];
666666
[self onAccessibilityStatusChanged:nil];
667-
[[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
668-
667+
if (UIApplication.sharedApplication.applicationState == UIApplicationStateActive) {
668+
[[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
669+
}
669670
[super viewDidAppear:animated];
670671
}
671672

0 commit comments

Comments
 (0)