Package io.flutter.plugin.common

# Interface BinaryMessenger.BinaryMessageHandler

Enclosing interface:
  `BinaryMessenger`

public static interface BinaryMessenger.BinaryMessageHandler
Handler for incoming binary messages from Flutter.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onMessage(ByteBuffer message, BinaryMessenger.BinaryReply reply)`
  Handles the specified message.

- ## Method Details

  - ### onMessage

    @UiThread void onMessage(@Nullable ByteBuffer message, @NonNull BinaryMessenger.BinaryReply reply)
    Handles the specified message.

    Handler implementations must reply to all incoming messages, by submitting a single reply message to the given `BinaryMessenger.BinaryReply`. Failure to do so will result in lingering Flutter reply handlers. The reply may be submitted asynchronously.

    Any uncaught exception thrown by this method will be caught by the messenger implementation and logged, and a null reply message will be sent back to Flutter.

    Parameters:
      `message` - the message `ByteBuffer` payload, possibly null.
      `reply` - A `BinaryMessenger.BinaryReply` used for submitting a reply back to Flutter.