Definition at line 13 of file FlutterChannelsTest.m.
◆ cleanUpConnection:
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: . |
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 16 of file FlutterChannelsTest.m.
46}
int64_t FlutterBinaryMessengerConnection
◆ init
Definition at line 16 of file FlutterChannelsTest.m.
19 {
20 self = [super init];
21 if (self) {
22 _handlers = [[NSMutableDictionary<NSString*, FlutterBinaryMessageHandler> alloc] init];
23 }
24 return self;
25}
◆ sendOnChannel:message:
- (void) sendOnChannel: |
|
(NSString *) |
channel |
message: |
|
(NSData *_Nullable) |
message |
|
|
| |
|
implementation |
Sends a binary message to the Flutter side on the specified channel, expecting no reply.
- Parameters
-
channel | The channel name. |
message | The message. |
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 16 of file FlutterChannelsTest.m.
28 [self sendOnChannel:channel message:message binaryReply:nil];
29}
◆ sendOnChannel:message:binaryReply:
- (void) sendOnChannel: |
|
(NSString *) |
channel |
message: |
|
(NSData *_Nullable) |
message |
binaryReply: |
|
(FlutterBinaryReply _Nullable) |
callback |
|
|
| |
|
implementation |
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. |
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 16 of file FlutterChannelsTest.m.
36}
NS_ASSUME_NONNULL_BEGIN typedef void(^ FlutterBinaryReply)(NSData *_Nullable reply)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
◆ setMessageHandlerOnChannel:binaryMessageHandler:
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.
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 16 of file FlutterChannelsTest.m.
39 binaryMessageHandler:
41 [self.handlers setObject:handler forKey:channel];
42 return 0;
43}
void(^ FlutterBinaryMessageHandler)(NSData *_Nullable message, FlutterBinaryReply reply)
◆ channel
◆ handlers
◆ message
The documentation for this class was generated from the following file: