分类
联系方式
  1. 新浪微博
  2. E-mail

BinaryMessenger

Java 接口

声明在 engine/shell/platform/android/io/flutter/plugin/common/BinaryMessenger.java。

接口注释:

Facility for communicating with Flutter using asynchronous message passing with binary messages.

The Flutter Dart code should use BinaryMessages to participate.

BinaryMessenger is expected to be utilized from a single thread throughout the duration of its existence. If created on the main thread, then all invocations should take place on the main thread. If created on a background thread, then all invocations should take place on that background thread.

BasicMessageChannel , which supports message passing with Strings and semi-structured messages.

MethodChannel , which supports communication using asynchronous method invocation.

EventChannel , which supports communication using event streams.

翻译:

使用二进制消息的异步消息传递与Flutter进行通信的设施。

Flutter Dart代码应使用BinaryMessages来参与。

BinaryMessenger在其存在的整个过程中,预计将从一个单一的线程中使用。如果在主线程上创建,那么所有的调用应该在主线程上进行。如果在后台线程上创建,那么所有的调用都应该在该后台线程上进行。

BasicMessageChannel , 它支持用字符串和半结构化消息传递消息。

MethodChannel , 支持使用异步方法调用进行通信。

EventChannel , 支持使用事件流进行通信。

实现类在哪里?DartMessenger 这个 Java 类。