Class: ChannelMessageListener
Implements
Constructors
Constructor
Copied to your clipboardnew ChannelMessageListener(sourceChannel,targetProtocolVersion,_filterRequestIdMismatch,protocolHandlersModule?): ChannelMessageListener;
Parameters
| Parameter | Type | Default value |
|---|---|---|
sourceChannel | undefined | |
targetProtocolVersion | ProtocolVersion.V1_3 | |
_filterRequestIdMismatch | boolean | false |
protocolHandlersModule? | undefined |
Returns
ChannelMessageListener
Methods
reset()
Copied to your clipboardreset(): void;
Returns
void
didGetMessage()
Copied to your clipboarddidGetMessage<T>(message, requestId?): void;
Type Parameters
| Type Parameter |
|---|
T extends MessageType |
Parameters
| Parameter | Type |
|---|---|
message | Message<T> |
requestId? | string |
Returns
void
Implementation of
IChannelMessengerDelegate.didGetMessage
setTarget()
Copied to your clipboardsetTarget(targetChannel, targetChannelInfo): void;
Parameters
| Parameter | Type |
|---|---|
targetChannel | |
targetChannelInfo |
Returns
void
removeTarget()
Copied to your clipboardremoveTarget(targetChannel): void;
Parameters
| Parameter | Type |
|---|---|
targetChannel |
Returns
void
hasTarget()
Copied to your clipboardhasTarget(targetChannel): boolean;
Parameters
| Parameter | Type |
|---|---|
targetChannel |
Returns
boolean
getTarget()
Copied to your clipboardgetTarget(targetChannel):| undefined| TargetChannelInfo;
Parameters
| Parameter | Type |
|---|---|
targetChannel |
Returns
| undefined
| TargetChannelInfo
addListenerForTarget()
Copied to your clipboardaddListenerForTarget(targetChannel, callback): void;
Parameters
| Parameter | Type |
|---|---|
targetChannel | |
callback |
Returns
void
sendMessage()
Copied to your clipboardsendMessage<T>(targetChannel, message): boolean;
Type Parameters
| Type Parameter |
|---|
T extends MessageType |
Parameters
| Parameter | Type |
|---|---|
targetChannel | |
message |
Returns
boolean
sendMessageCompat()
Copied to your clipboardsendMessageCompat<T>(targetChannel, message): boolean;
Sends a message using a message channel that is compatible with older version of SDK.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends MessageType | The type of the message being sent. |
Parameters
| Parameter | Type | Description |
|---|---|---|
targetChannel | ||
message | The message to send. |
Returns
boolean
- True if the message was successfully sent, false otherwise.
addListener()
Copied to your clipboardaddListener(messageType,listener,messageFilter?): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
messageType | Listener is invoked for incoming message of this message type. | |
listener | Callback function that is invoked when there is an incoming message. | |
messageFilter? | Filter the incoming message. If this function returns true the element is passed downstream, if it returns false the element is discarded. |
Returns
void
removeListener()
Copied to your clipboardremoveListener(messageType, listener): void;
Parameters
| Parameter | Type |
|---|---|
messageType | |
listener |
Returns
void
setRequestId()
Copied to your clipboardsetRequestId(requestId): void;
Parameters
| Parameter | Type |
|---|---|
requestId | string |
Returns
void
