fix: fix kraken.methodChannel.setMethodCallHandler did't get called before kraken.invokeMethod called. #289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed #287
在之前的实现中,由于 Dart 向 JS 侧发送消息的回调函数会在 MethodChannel module 初始化的时候绑定,而 module 的设计是只有调用方法的时候才进行初始化,这就导致了在 MethodChannelModule 在初始化之前,都无法调用 JS 侧的方法。
将回调函数的绑定移动到 KrakenController 初始化阶段即可解决这个问题。