Skip to content

Instantly share code, notes, and snippets.

@chinmaygarde
Created July 7, 2020 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chinmaygarde/b759b8a85571a979a33df16dcc852b05 to your computer and use it in GitHub Desktop.
Save chinmaygarde/b759b8a85571a979a33df16dcc852b05 to your computer and use it in GitHub Desktop.
diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
index bc8f4c457..ee1df602c 100644
--- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
+++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
@@ -489,6 +489,11 @@ static void sendFakeTouchEvent(FlutterEngine* engine,
// NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and raster
// thread.
if (appeared) {
+ if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
+ NSLog(@"Attempted to call surface appeared while still in the background. Ignoring.");
+ return;
+ }
+
[self installFirstFrameCallback];
[_engine.get() platformViewsController]->SetFlutterView(_flutterView.get());
[_engine.get() platformViewsController]->SetFlutterViewController(self);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment