Flutter Engine
The Flutter Engine
Instance Methods | Properties | List of all members
FlutterBinaryMessengerRelay Class Reference

#import <FlutterBinaryMessengerRelay.h>

Inheritance diagram for FlutterBinaryMessengerRelay:
<FlutterBinaryMessenger> FakeBinaryMessengerRelay

Instance Methods

(instancetype) - initWithParent:
 
(void) - sendOnChannel:message: [implementation]
 
(void) - sendOnChannel:message:binaryReply: [implementation]
 
(NSObject< FlutterTaskQueue > *) - makeBackgroundTaskQueue [implementation]
 TODO(gaaclarke): Remove optional when macos supports Background Platform Channels. More...
 
(FlutterBinaryMessengerConnection- setMessageHandlerOnChannel:binaryMessageHandler: [implementation]
 
(FlutterBinaryMessengerConnection- setMessageHandlerOnChannel:binaryMessageHandler:taskQueue: [implementation]
 
(void) - cleanUpConnection: [implementation]
 
- Instance Methods inherited from <FlutterBinaryMessenger>
(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:
 

Properties

NSObject< FlutterBinaryMessenger > * parent
 

Detailed Description

Definition at line 14 of file FlutterBinaryMessengerRelay.h.

Method Documentation

◆ cleanUpConnection:

- (void) cleanUpConnection: (FlutterBinaryMessengerConnection connection
implementation

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 from <FlutterBinaryMessenger>.

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

74 if (self.parent) {
75 return [self.parent cleanUpConnection:connection];
76 } else {
77 FML_LOG(WARNING) << "Communicating on a dead channel.";
78 }
79}
int64_t FlutterBinaryMessengerConnection
#define FML_LOG(severity)
Definition: logging.h:82
NSObject< FlutterBinaryMessenger > * parent

◆ initWithParent:

- (instancetype) initWithParent: (NSObject<FlutterBinaryMessenger>*)  parent

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

14 :(NSObject<FlutterBinaryMessenger>*)parent {
15 self = [super init];
16 if (self != nil) {
17 _parent = parent;
18 }
19 return self;
20}

◆ makeBackgroundTaskQueue

- (NSObject< FlutterTaskQueue > *) makeBackgroundTaskQueue
implementation

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

Reimplemented from <FlutterBinaryMessenger>.

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

40 {
41 if (self.parent) {
42 return [self.parent makeBackgroundTaskQueue];
43 } else {
44 return nil;
45 };
46}

◆ sendOnChannel:message:

- (void) sendOnChannel: (NSString*)  channel
message: (NSData*)  message 
implementation

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

22 :(NSString*)channel message:(NSData*)message {
23 if (self.parent) {
24 [self.parent sendOnChannel:channel message:message binaryReply:nil];
25 } else {
26 FML_LOG(WARNING) << "Communicating on a dead channel.";
27 }
28}
Win32Message message

◆ sendOnChannel:message:binaryReply:

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

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

30 :(NSString*)channel
31 message:(NSData*)message
32 binaryReply:(FlutterBinaryReply)callback {
33 if (self.parent) {
34 [self.parent sendOnChannel:channel message:message binaryReply:callback];
35 } else {
36 FML_LOG(WARNING) << "Communicating on a dead channel.";
37 }
38}
NS_ASSUME_NONNULL_BEGIN typedef void(^ FlutterBinaryReply)(NSData *_Nullable reply)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback

◆ setMessageHandlerOnChannel:binaryMessageHandler:

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

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

48 :(NSString*)channel
49 binaryMessageHandler:
51 if (self.parent) {
52 return [self.parent setMessageHandlerOnChannel:channel binaryMessageHandler:handler];
53 } else {
54 FML_LOG(WARNING) << "Communicating on a dead channel.";
55 return -1;
56 }
57}
void(^ FlutterBinaryMessageHandler)(NSData *_Nullable message, FlutterBinaryReply reply)

◆ setMessageHandlerOnChannel:binaryMessageHandler:taskQueue:

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

Definition at line 9 of file FlutterBinaryMessengerRelay.mm.

59 :(NSString*)channel
60 binaryMessageHandler:(FlutterBinaryMessageHandler)handler
61 taskQueue:
62 (NSObject<FlutterTaskQueue>*)taskQueue {
63 if (self.parent) {
64 return [self.parent setMessageHandlerOnChannel:channel
65 binaryMessageHandler:handler
66 taskQueue:taskQueue];
67 } else {
68 FML_LOG(WARNING) << "Communicating on a dead channel.";
69 return -1;
70 }
71}

Property Documentation

◆ parent

- (NSObject<FlutterBinaryMessenger>*) parent
readwritenonatomicweak

Definition at line 15 of file FlutterBinaryMessengerRelay.h.


The documentation for this class was generated from the following files: