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

#import <FlutterBinaryMessenger.h>

Inheritance diagram for <FlutterBinaryMessenger>:
FlutterBinaryMessengerRelay FlutterEngine FlutterEngine(Test) FlutterViewController MockBinaryMessenger FakeBinaryMessengerRelay FlutterEnginePartialMock FlutterEngineSpy FlutterHeadlessDartRunner MockableFlutterEngine AccessibilityBridgeTestViewController MouseEventFlutterViewController NoStatusBarFlutterViewController ShareViewController TextInputTestViewController

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

Reimplemented in FlutterBinaryMessengerRelay, MockBinaryMessenger, FlutterEngine, and FlutterViewController.

◆ makeBackgroundTaskQueue

- (NSObject< FlutterTaskQueue > *) makeBackgroundTaskQueue
optional

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

Reimplemented in FlutterBinaryMessengerRelay, FlutterEngine, and FlutterViewController.

◆ 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.

Reimplemented in MockBinaryMessenger.

◆ 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.

Reimplemented in MockBinaryMessenger, and FlutterEngine.

◆ 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.

Reimplemented in MockBinaryMessenger.

◆ setMessageHandlerOnChannel:binaryMessageHandler:taskQueue:

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

Reimplemented in FlutterViewController.


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