FlutterBinaryMessenger
@protocol FlutterBinaryMessenger <NSObject>
A facility for communicating with the Flutter side using asynchronous message passing with binary messages.
Implementated by:
FlutterBasicMessageChannel, which supports communication using structured messages.FlutterMethodChannel, which supports communication using asynchronous method calls.FlutterEventChannel, which supports commuication using event streams.
-
Undocumented
Declaration
Objective-C
- (NSObject<FlutterTaskQueue>*)makeBackgroundTaskQueue; -
Undocumented
Declaration
Objective-C
- (FlutterBinaryMessengerConnection) setMessageHandlerOnChannel:(NSString*)channel binaryMessageHandler:(FlutterBinaryMessageHandler _Nullable)handler taskQueue:(NSObject<FlutterTaskQueue>* _Nullable)taskQueue; -
Sends a binary message to the Flutter side on the specified channel, expecting no reply.
Declaration
Objective-C
- (void)sendOnChannel:(nonnull NSString *)channel message:(NSData *_Nullable)message;Parameters
channelThe channel name.
messageThe message.
-
Sends a binary message to the Flutter side on the specified channel, expecting an asynchronous reply.
Declaration
Objective-C
- (void)sendOnChannel:(nonnull NSString *)channel message:(NSData *_Nullable)message binaryReply:(FlutterBinaryReply _Nullable)callback;Parameters
channelThe channel name.
messageThe message.
callbackA callback for receiving a reply.
-
Registers a message handler for incoming binary messages from the Flutter side on the specified channel.
Replaces any existing handler. Use a
nilhandler for unregistering the existing handler.Declaration
Objective-C
- (FlutterBinaryMessengerConnection) setMessageHandlerOnChannel:(nonnull NSString *)channel binaryMessageHandler:(FlutterBinaryMessageHandler _Nullable)handler;Parameters
channelThe channel name.
handlerThe message handler.
Return Value
An identifier that represents the connection that was just created to the channel.
-
Clears out a channel’s message handler if that handler is still the one that was created as a result of
setMessageHandlerOnChannel:binaryMessageHandler:.Declaration
Objective-C
- (void)cleanUpConnection:(FlutterBinaryMessengerConnection)connection;Parameters
connectionThe result from
setMessageHandlerOnChannel:binaryMessageHandler:.
View on GitHub
Install in Dash
FlutterBinaryMessenger Protocol Reference