Ver Fonte

Fixed crash issue on Flutter >= 0.10.2

Steve há 7 anos atrás
pai
commit
ffd99e4644
1 ficheiros alterados com 1 adições e 1 exclusões
  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];