Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart 调用 js 方法没有返回值吗 #1424

Open
DemoJameson opened this issue Jun 1, 2022 · 1 comment
Open

dart 调用 js 方法没有返回值吗 #1424

DemoJameson opened this issue Jun 1, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@DemoJameson
Copy link

js

kraken.methodChannel.addMethodCallHandler((method, args) => "123456789");

dart

final result = await javaScriptChannel.invokeMethod('test', null);
debugPrint('invoke test result: $result'); // invoke test result: null
@DemoJameson DemoJameson added the enhancement New feature or request label Jun 1, 2022
@xuzhongpeng
Copy link
Member

xuzhongpeng commented Jun 20, 2022

当前设计js侧addMethodCallHandler可以多次调用且每个回调都可以接收到监听,如果要能接收到返回值,应该需要一个新的API设计,cc @andycall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants