From aca88cb779d3f06988dcd4f8da7e6bc12456d17b Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 14 Nov 2018 14:51:42 +0700 Subject: [PATCH] Fixed crash issue on Flutter >= 0.10.2 --- ios/Classes/FlutterWebviewPlugin.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/FlutterWebviewPlugin.m b/ios/Classes/FlutterWebviewPlugin.m index 7aeb18be..ef455c7b 100644 --- a/ios/Classes/FlutterWebviewPlugin.m +++ b/ios/Classes/FlutterWebviewPlugin.m @@ -15,7 +15,7 @@ + (void)registerWithRegistrar:(NSObject*)registrar { methodChannelWithName:CHANNEL_NAME binaryMessenger:[registrar messenger]]; - UIViewController *viewController = (UIViewController *)registrar.messenger; + UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController; FlutterWebviewPlugin* instance = [[FlutterWebviewPlugin alloc] initWithViewController:viewController]; [registrar addMethodCallDelegate:instance channel:channel];