Flutter Engine
The Flutter Engine
|
#import <FlutterChannels.h>
Instance Methods | |
(instancetype) | - initWithName:binaryMessenger:codec: |
(instancetype) | - initWithName:binaryMessenger:codec:taskQueue: |
(void) | - sendMessage: |
(void) | - sendMessage:reply: |
(void) | - setMessageHandler: |
(void) | - resizeChannelBuffer: |
(void) | - setWarnsOnOverflow: |
(instancetype) | - initWithName:binaryMessenger:codec:taskQueue: [implementation] |
(void) | - sendMessage: [implementation] |
(void) | - sendMessage:reply: [implementation] |
(void) | - setMessageHandler: [implementation] |
Class Methods | |
(instancetype) | + messageChannelWithName:binaryMessenger: |
(instancetype) | + messageChannelWithName:binaryMessenger:codec: |
(void) | + resizeChannelWithName:binaryMessenger:size: |
(void) | + setWarnsOnOverflow:forChannelWithName:binaryMessenger: |
A channel for communicating with the Flutter side using basic, asynchronous message passing.
Definition at line 37 of file FlutterChannels.h.
- (instancetype) initWithName: | (NSString*) | name | |
binaryMessenger: | (NSObject<FlutterBinaryMessenger>*) | messenger | |
codec: | (NSObject<FlutterMessageCodec>*) | codec | |
Initializes a FlutterBasicMessageChannel
with the specified name, binary messenger, and message codec.
The channel name logically identifies the channel; identically named channels interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by FlutterEngine
and FlutterViewController
.
name | The channel name. |
messenger | The binary messenger. |
codec | The message codec. |
Definition at line 73 of file FlutterChannels.mm.
|
implementation |
Definition at line 73 of file FlutterChannels.mm.
- (instancetype) initWithName: | (NSString *) | name | |
binaryMessenger: | (NSObject< FlutterBinaryMessenger > *) | messenger | |
codec: | (NSObject< FlutterMessageCodec > *) | codec | |
taskQueue: | (NSObject< FlutterTaskQueue > *_Nullable) | taskQueue | |
Initializes a FlutterBasicMessageChannel
with the specified name, binary messenger, and message codec.
The channel name logically identifies the channel; identically named channels interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by FlutterEngine
and FlutterViewController
.
name | The channel name. |
messenger | The binary messenger. |
codec | The message codec. |
taskQueue | The FlutterTaskQueue that executes the handler (see -[FlutterBinaryMessenger makeBackgroundTaskQueue]). |
+ (instancetype) messageChannelWithName: | (NSString*) | name | |
binaryMessenger: | (NSObject<FlutterBinaryMessenger>*) | messenger | |
Creates a FlutterBasicMessageChannel
with the specified name and binary messenger.
The channel name logically identifies the channel; identically named channels interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by FlutterEngine
and FlutterViewController
.
The channel uses FlutterStandardMessageCodec
to encode and decode messages.
name | The channel name. |
messenger | The binary messenger. |
Definition at line 73 of file FlutterChannels.mm.
+ (instancetype) messageChannelWithName: | (NSString*) | name | |
binaryMessenger: | (NSObject<FlutterBinaryMessenger>*) | messenger | |
codec: | (NSObject<FlutterMessageCodec>*) | codec | |
Creates a FlutterBasicMessageChannel
with the specified name, binary messenger, and message codec.
The channel name logically identifies the channel; identically named channels interfere with each other's communication.
The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by FlutterEngine
and FlutterViewController
.
name | The channel name. |
messenger | The binary messenger. |
codec | The message codec. |
Definition at line 73 of file FlutterChannels.mm.
- (void) resizeChannelBuffer: | (NSInteger) | newSize |
Adjusts the number of messages that will get buffered when sending messages to channels that aren't fully set up yet. For example, the engine isn't running yet or the channel's message handler isn't set up on the Dart side yet.
newSize | The number of messages that will get buffered. |
Definition at line 73 of file FlutterChannels.mm.
+ (void) resizeChannelWithName: | (NSString*) | name | |
binaryMessenger: | (NSObject<FlutterBinaryMessenger>*) | messenger | |
size: | (NSInteger) | newSize | |
Adjusts the number of messages that will get buffered when sending messages to channels that aren't fully set up yet. For example, the engine isn't running yet or the channel's message handler isn't set up on the Dart side yet.
name | The channel name. |
messenger | The binary messenger. |
newSize | The number of messages that will get buffered. |
Definition at line 73 of file FlutterChannels.mm.
- (void) sendMessage: | (id _Nullable) | message |
Sends the specified message to the Flutter side, ignoring any reply.
message | The message. Must be supported by the codec of this channel. |
Reimplemented in FakeMessageChannel.
|
implementation |
Definition at line 73 of file FlutterChannels.mm.
- (void) sendMessage: | (id _Nullable) | message | |
reply: | (FlutterReply _Nullable) | callback | |
Sends the specified message to the Flutter side, expecting an asynchronous reply.
message | The message. Must be supported by the codec of this channel. |
callback | A callback to be invoked with the message reply from Flutter. |
Reimplemented in FakeMessageChannel.
|
implementation |
Definition at line 73 of file FlutterChannels.mm.
- (void) setMessageHandler: | (FlutterMessageHandler _Nullable) | handler |
Registers a message handler with this channel.
Replaces any existing handler. Use a nil
handler for unregistering the existing handler.
handler | The message handler. |
|
implementation |
Definition at line 73 of file FlutterChannels.mm.
- (void) setWarnsOnOverflow: | (BOOL) | warns |
Defines whether the channel should show warning messages when discarding messages due to overflow.
warns | When false, the channel is expected to overflow and warning messages will not be shown. |
Definition at line 73 of file FlutterChannels.mm.
+ (void) setWarnsOnOverflow: | (BOOL) | warns | |
forChannelWithName: | (NSString*) | name | |
binaryMessenger: | (NSObject<FlutterBinaryMessenger>*) | messenger | |
Defines whether the channel should show warning messages when discarding messages due to overflow.
warns | When false, the channel is expected to overflow and warning messages will not be shown. |
name | The channel name. |
messenger | The binary messenger. |
Definition at line 73 of file FlutterChannels.mm.