Skip to content

Commit a0ddb95

Browse files
authored
Merge pull request #236 from dinhha/master
Fixed crash issue on Flutter >= 0.10.2
2 parents d70cb45 + aca88cb commit a0ddb95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ios/Classes/FlutterWebviewPlugin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
1515
methodChannelWithName:CHANNEL_NAME
1616
binaryMessenger:[registrar messenger]];
1717

18-
UIViewController *viewController = (UIViewController *)registrar.messenger;
18+
UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController;
1919
FlutterWebviewPlugin* instance = [[FlutterWebviewPlugin alloc] initWithViewController:viewController];
2020

2121
[registrar addMethodCallDelegate:instance channel:channel];

0 commit comments

Comments
 (0)