|
|
@@ -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];
|