Class: ChannelMessageListener
Implements
Constructors
Constructor
new ChannelMessageListener(
sourceChannel,
targetProtocolVersion,
_filterRequestIdMismatch,
protocolHandlersModule?): ChannelMessageListener;
Parameters
Parameter
Type
Default value
_filterRequestIdMismatchbooleanfalseReturns
ChannelMessageListener
Methods
reset()
reset(): void;
Returns
void
didGetMessage()
didGetMessage<T>(message, requestId?): void;
Type Parameters
Type Parameter
T extends MessageTypeParameters
Returns
void
Implementation of
IChannelMessengerDelegate.didGetMessage
setTarget()
setTarget(targetChannel, targetChannelInfo): void;
Parameters
Returns
void
removeTarget()
removeTarget(targetChannel): void;
Parameters
Parameter
Type
targetChannelReturns
void
hasTarget()
hasTarget(targetChannel): boolean;
Parameters
Parameter
Type
targetChannelReturns
boolean
getTarget()
getTarget(targetChannel):
| TargetChannelInfo
| undefined;
Parameters
Parameter
Type
targetChannelReturns
| TargetChannelInfo | undefined
addListenerForTarget()
addListenerForTarget(targetChannel, callback): void;
Parameters
Returns
void
sendMessage()
sendMessage<T>(targetChannel, message): boolean;
Type Parameters
Type Parameter
T extends MessageTypeParameters
Returns
boolean
sendMessageCompat()
sendMessageCompat<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 MessageTypeThe type of the message being sent.
Parameters
Parameter
Type
Description
targetChannelReturns
boolean
- True if the message was successfully sent, false otherwise.
addListener()
addListener(
messageType,
listener,
messageFilter?): void;
Parameters
Parameter
Type
Description
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()
removeListener(messageType, listener): void;
Parameters
Returns
void
setRequestId()
setRequestId(requestId): void;
Parameters
Parameter
Type
requestIdstringReturns
void