提交 a24fc79e authored 作者: jskyzhang's avatar jskyzhang 提交者: JarvanMo

fix #338

上级 5f4e93b4
...@@ -10,14 +10,23 @@ FluwxShareHandler *_fluwxShareHandler; ...@@ -10,14 +10,23 @@ FluwxShareHandler *_fluwxShareHandler;
BOOL handleOpenURLByFluwx = YES; BOOL handleOpenURLByFluwx = YES;
FlutterMethodChannel *channel = nil;
+ (void)registerWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar { + (void)registerWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
FlutterMethodChannel *channel = [FlutterMethodChannel
methodChannelWithName:@"com.jarvanmo/fluwx" #if TARGET_OS_IPHONE
binaryMessenger:[registrar messenger]]; if (channel == nil) {
FluwxPlugin *instance = [[FluwxPlugin alloc] initWithRegistrar:registrar methodChannel:channel]; #endif
[registrar addMethodCallDelegate:instance channel:channel]; channel = [FlutterMethodChannel
[[FluwxResponseHandler defaultManager] setMethodChannel:channel]; methodChannelWithName:@"com.jarvanmo/fluwx"
[registrar addApplicationDelegate:instance]; binaryMessenger:[registrar messenger]];
FluwxPlugin *instance = [[FluwxPlugin alloc] initWithRegistrar:registrar methodChannel:channel];
[registrar addMethodCallDelegate:instance channel:channel];
[[FluwxResponseHandler defaultManager] setMethodChannel:channel];
[registrar addApplicationDelegate:instance];
#if TARGET_OS_IPHONE
}
#endif
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论