Open foxsofter opened 3 years ago
Issue occurs on: both Plugin version: all Flutter doctor output: x
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { channel = [FlutterMethodChannel methodChannelWithName:CHANNEL_NAME binaryMessenger:[registrar messenger]]; UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController; FlutterWebviewPlugin* instance = [[FlutterWebviewPlugin alloc] initWithViewController:viewController]; [registrar addMethodCallDelegate:instance channel:channel]; }
Getting it from the engine when needed is the right solution,because the ViewController of FlutterEngine may change at any time. here
System info
Issue occurs on: both Plugin version: all Flutter doctor output: x