Skip to main content

Handling Events

Running an app containing the SDK allows you to send messages or perform other actions. At the same time, when the app is online it will fetch events send to it (e.g. receiving a message). The SDK parses these events and then allows you to setup a "callback", triggering actions based on specific events being received.

For example, you might want to "react" to "text message received", and make a Rest call when the message contains a specific string, or you might want to track when a new users joins a conversation where the app is present.

Practically, when you implement some of the events handler of WireEventsHandler, your App will be notified when an event is received from the WebSocket connection.

Below is a table of existing events that can be received and what are their purpose:

NameDescription
onTextMessageReceivedA Text message was received.
onAppAddedToConversationThe App has been added to a conversation.
onConversationDeletedA conversation that the App was part of, was deleted.
onAssetMessageReceivedAn Asset (file) was received.
onButtonClickedA button action (button press/click) was received. From a composite message.
onPingReceivedAttention-getting message was received.
onLocationMessageReceivedA message containing location details (longitude, latitude).
onMessageDeletedWhen a message is deleted.
onMessageDeliveredWhen your message was DELIVERED or another user has read your message.
onTextMessageEditedAn existing message was edited.
onMessageReactionReceivedWhen a user has reacted to a message.
onInCallReactionReceivedReceived an emoji while in a call.
onInCallHandRaiseReceivedReceived the Hand Raise emoji while in a call.
onUserJoinedConversationWhen one or more users joined a conversation the App is part of.
onUserLeftConversationWhen one or more members leave or are removed from a conversation, including cases where the app itself is removed from the conversation.