Skip to content

Commit

Permalink
Fixed crash issue on Flutter >= 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhha authored Nov 14, 2018
1 parent f0e8e71 commit aca88cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Classes/FlutterWebviewPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)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];
Expand Down

0 comments on commit aca88cb

Please sign in to comment.