From 38dd52719b44d57c162e06d819df8dcbb02b951b Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Wed, 25 May 2016 16:57:32 -0700 Subject: [PATCH] Close the app after the user acknowledges the Launch Error alert. (#2711) * Close the app after the user acknowledges the Launch Error alert. --- .../ios/framework/Source/FlutterViewController.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sky/shell/platform/ios/framework/Source/FlutterViewController.mm b/sky/shell/platform/ios/framework/Source/FlutterViewController.mm index 1d49b83bd3a..81fccefd492 100644 --- a/sky/shell/platform/ios/framework/Source/FlutterViewController.mm +++ b/sky/shell/platform/ios/framework/Source/FlutterViewController.mm @@ -31,6 +31,9 @@ #include "sky/shell/shell.h" #include "sky/shell/shell_view.h" +@interface FlutterViewController() +@end + void FlutterInit(int argc, const char* argv[]) { NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; @@ -141,6 +144,11 @@ void FlutterInit(int argc, const char* argv[]) { #pragma mark - Initializing the engine +- (void)alertView:(UIAlertView*)alertView +clickedButtonAtIndex:(NSInteger)buttonIndex { + exit(0); +} + - (void)connectToEngineAndLoad { TRACE_EVENT0("flutter", "connectToEngineAndLoad"); @@ -160,7 +168,7 @@ void FlutterInit(int argc, const char* argv[]) { UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Launch Error" message:message - delegate:nil + delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show];