Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit fe1a9da

Browse files
author
Ye Chunlin
committed
If app not in foreground, don't send resume message
1 parent f3f9ab0 commit fe1a9da

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,10 @@ - (void)viewDidAppear:(BOOL)animated {
626626
TRACE_EVENT0("flutter", "viewDidAppear");
627627
[self onUserSettingsChanged:nil];
628628
[self onAccessibilityStatusChanged:nil];
629-
[[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
630-
631-
[super viewDidAppear:animated];
632-
if (UIApplication.sharedApplication.applicationState == UIApplicationStateBackground) {
633-
[[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.paused"];
629+
if (UIApplication.sharedApplication.applicationState == UIApplicationStateActive) {
630+
[[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
634631
}
632+
[super viewDidAppear:animated];
635633
}
636634

637635
- (void)viewWillDisappear:(BOOL)animated {

0 commit comments

Comments
 (0)