Explorar el Código

Merge pull request #236 from dinhha/master

Fixed crash issue on Flutter >= 0.10.2
Rafal Wachol hace 7 años
padre
commit
3e18cec872
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      ios/Classes/FlutterWebviewPlugin.m

+ 1 - 1
ios/Classes/FlutterWebviewPlugin.m

@@ -15,7 +15,7 @@ static NSString *const CHANNEL_NAME = @"flutter_webview_plugin";
                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];