public static interface BasicMessageChannel.MessageHandler<T>
Modifier and Type | Method and Description |
---|---|
void |
onMessage(T message,
BasicMessageChannel.Reply<T> reply)
Handles the specified message received from Flutter.
|
void onMessage(T message, BasicMessageChannel.Reply<T> reply)
Handler implementations must reply to all incoming messages, by submitting a single reply
message to the given BasicMessageChannel.Reply
. Failure to do so will result in lingering Flutter reply
handlers. The reply may be submitted asynchronously.
Any uncaught exception thrown by this method, or the preceding message decoding, will be caught by the channel implementation and logged, and a null reply message will be sent back to Flutter.
Any uncaught exception thrown during encoding a reply message submitted to the BasicMessageChannel.Reply
is treated similarly: the exception is logged, and a null reply is sent to Flutter.
message
- the message, possibly null.reply
- a BasicMessageChannel.Reply
for sending a single message reply back to Flutter.