Flutter iOS Embedder
<FlutterBinaryMessenger> Protocol Reference

#import <FlutterBinaryMessenger.h>

Inheritance diagram for <FlutterBinaryMessenger>:
FlutterBinaryMessengerRelay FlutterEngine() FlutterEngine(Test) FlutterViewController() MockBinaryMessenger FakeBinaryMessengerRelay

Instance Methods

(NSObject< FlutterTaskQueue > *) - makeBackgroundTaskQueue
 TODO(gaaclarke): Remove optional when macos supports Background Platform Channels. More...
 
(FlutterBinaryMessengerConnection- setMessageHandlerOnChannel:binaryMessageHandler:taskQueue:
 
(void) - sendOnChannel:message:
 
(void) - sendOnChannel:message:binaryReply:
 
(FlutterBinaryMessengerConnection- setMessageHandlerOnChannel:binaryMessageHandler:
 
(void) - cleanUpConnection:
 

Detailed Description

A facility for communicating with the Flutter side using asynchronous message passing with binary messages.

Implementated by:

Definition at line 49 of file FlutterBinaryMessenger.h.

Method Documentation

◆ cleanUpConnection:

- (void) cleanUpConnection: (FlutterBinaryMessengerConnection connection
required

Clears out a channel's message handler if that handler is still the one that was created as a result of setMessageHandlerOnChannel:binaryMessageHandler:.

Parameters
connectionThe result from setMessageHandlerOnChannel:binaryMessageHandler:.

◆ makeBackgroundTaskQueue

- (NSObject<FlutterTaskQueue>*) makeBackgroundTaskQueue
optional

TODO(gaaclarke): Remove optional when macos supports Background Platform Channels.

◆ sendOnChannel:message:

- (void) sendOnChannel: (NSString *)  channel
message: (NSData *_Nullable)  message 
required

Sends a binary message to the Flutter side on the specified channel, expecting no reply.

Parameters
channelThe channel name.
messageThe message.

◆ sendOnChannel:message:binaryReply:

- (void) sendOnChannel: (NSString *)  channel
message: (NSData *_Nullable)  message
binaryReply: (FlutterBinaryReply _Nullable)  callback 
required

Sends a binary message to the Flutter side on the specified channel, expecting an asynchronous reply.

Parameters
channelThe channel name.
messageThe message.
callbackA callback for receiving a reply.

◆ setMessageHandlerOnChannel:binaryMessageHandler:

- (FlutterBinaryMessengerConnection) setMessageHandlerOnChannel: (NSString *)  channel
binaryMessageHandler: (FlutterBinaryMessageHandler _Nullable)  handler 
required

Registers a message handler for incoming binary messages from the Flutter side on the specified channel.

Replaces any existing handler. Use a nil handler for unregistering the existing handler.

Parameters
channelThe channel name.
handlerThe message handler.
Returns
An identifier that represents the connection that was just created to the channel.

◆ setMessageHandlerOnChannel:binaryMessageHandler:taskQueue:

- (FlutterBinaryMessengerConnection) setMessageHandlerOnChannel: (NSString *)  channel
binaryMessageHandler: (FlutterBinaryMessageHandler _Nullable)  handler
taskQueue: (NSObject< FlutterTaskQueue > *_Nullable)  taskQueue 
optional

The documentation for this protocol was generated from the following file: