MessengerEventType
Constants
isRead
Triggered for all clients in the conversation as the result of Conversation.markAsRead or similar methods from other Voximplant SDKs and Messaging API.
The listener is called with IsReadMessageEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
message:
Message instance with message information.
sequence:
number
Sequence number for the event.
timestamp:
number
UNIX timestamp (seconds) when the message event has been triggered.
onCreateConversation
Triggered if a conversation is created via Messenger.createConversation or similar methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation.
The listener is called with OnCreateConversationEvent and a payload.
Parameters
action:
Action that triggered this event.
conversation:
Conversation instance with the conversation details.
imUserId:
number
IM ID of the user that initiated the event.
sequence:
number
Sequence number of the event.
timestamp:
number
UNIX timestamp (seconds) when the event has been dispatched by the cloud.
onEditConversation
Triggered if the conversation properties have been modified as the result of:
- Messenger.joinConversation
- Messenger.leaveConversation
- Conversation.addParticipants
- Conversation.removeParticipants
- Conversation.editParticipants
- Conversation.edit
- or similar methods from other Voximplant SDKs and Messaging API
Triggered only for participants that belong to the conversation.
The listener is called with OnEditConversationEvent and a payload.
Parameters
action:
Action that triggered this event.
conversation:
Conversation instance with the conversation details.
imUserId:
number
IM ID of the user that initiated the event.
sequence:
number
Sequence number of the event.
timestamp:
number
UNIX timestamp (seconds) when the event has been dispatched by the cloud.
onEditMessage
Triggered if a message has been edited via Message.edit or similar methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation with the changed message.
The listener is called with OnEditMessageEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
message:
Message instance with message information.
sequence:
number
Sequence number for the event.
timestamp:
number
UNIX timestamp (seconds) when the message event has been triggered.
onEditUser
Triggered as the result of Messenger.editUser or similar methods from other Voximplant SDKs and Messaging API.
Triggered only for the subscribers of the changed user.
Use the Messenger.subscribe API to subscribe for user's changes.
The listener is called with OnEditUserEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
user:
User instance with user information.
onRemoveConversation
Triggered if a conversation has been removed.
Note that removal is possible only via the Voximplant Messaging API.
Triggered only for participants that belong to the conversation.
The listener is called with OnRemoveConversationEvent and a payload.
Parameters
action:
Action that triggered this event.
conversation:
Conversation instance with the conversation details.
imUserId:
number
IM ID of the user that initiated the event.
sequence:
number
Sequence number of the event.
timestamp:
number
UNIX timestamp (seconds) when the event has been dispatched by the cloud.
onRemoveMessage
Triggered if a message has been removed from a conversation via Message.remove or similar methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation with the deleted message.
The listener is called with OnRemoveMessageEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
message:
Message instance with message information.
sequence:
number
Sequence number for the event.
timestamp:
number
UNIX timestamp (seconds) when the message event has been triggered.
onSendMessage
Triggered if a new message has been sent to a conversation via Conversation.sendMessage or similar methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation.
The listener is called with OnSendMessageEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
message:
Message instance with message information.
sequence:
number
Sequence number for the event.
timestamp:
number
UNIX timestamp (seconds) when the message event has been triggered.
onSetStatus
Triggered if a user status has been changed via Messenger.setStatus or similar methods from other Voximplant SDKs and Messaging API.
Triggered only for the subscribers of the changed user.
Use the Messenger.subscribe API to subscribe for user's changes.
The listener is called with OnSetStatusEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
isOnline:
boolean
User status.
onSubscribe
Triggered as the result of Messenger.subscribe or similar methods from other Voximplant SDKs and Messaging API.
Triggered on all logged in clients of the current user.
The listener is called with OnSubscribeEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
users:
number[]
Array of the IM user identifiers of the current (un)subscription.
onTyping
Triggered when a user is typing in a conversation.
Typing information is received via Conversation.typing or similar methods from other Voximplant SDKs and the Messaging API.
Event triggers only for participants in the conversation where someone is typing in conversation.
The listener is called with OnTypingMessageEvent and a payload.
Parameters
action:
Action that triggered this event.
conversationUuid:
string
Conversation UUID associated with the event.
imUserId:
number
IM ID of the user that initiated the event.
sequence:
null | number
Sequence number of the event that has been marked as read by the user who initiated this event.
Only available for MessengerEventType.isRead.
onUnsubscribe
Triggered as the result of Messenger.unsubscribe or similar methods from other Voximplant SDKs and Messaging API.
Triggered on all logged in clients of the current user.
The listener is called with OnUnsubscribeEvent and a payload.
Parameters
action:
Action that triggered this event.
imUserId:
number
IM ID of the user that initiated the event.
users:
number[]
Array of the IM user identifiers of the current (un)subscription.