| Flutter iOS Embedder |

Instance Methods | List of all members
<FlutterBinaryMessenger> Protocol Reference

`#import <FlutterBinaryMessenger.h>`

Inheritance diagram for <FlutterBinaryMessenger>:

## 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:

- `FlutterBasicMessageChannel`, which supports communication using structured messages.
- `FlutterMethodChannel`, which supports communication using asynchronous method calls.
- `FlutterEventChannel`, which supports commuication using event streams.

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

  connection | The 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

  channel | The channel name.
  message | The 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

  channel | The channel name.
  message | The message.
  callback | A 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

  channel | The channel name.
  handler | The 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:

- shell/platform/darwin/common/framework/Headers/FlutterBinaryMessenger.h