Flutter(iOS):原生跳转flutter页面出现Unha
2020-04-26 本文已影响0人
棋剑千秋
-
(void)pushFlutterViewController_EventChannel {
FlutterViewController* flutterViewController = [[FlutterViewController alloc] initWithProject:nil nibName:nil bundle:nil];
[flutterViewController setInitialRoute:@"test?id=47"];
flutterViewController.splashScreenView.hidden = YES;
[GeneratedPluginRegistrant registerWithRegistry:flutterViewController];
// self.navigationController.navigationBarHidden = YES;
[self.navigationController pushViewController:flutterViewController animated:NO];
}
在原生中需要跳转到flutter指定页现出现MissingPluginException错误:
image.png
解决方法-手动注册该插件:
[GeneratedPluginRegistrant registerWithRegistry:flutterViewController];