IMessengerListener
Interface that may be used to handle messenger events.
Methods are invoked either on:
- the current user's side only. The events always invoked only on a client where messaging methods are called (unless otherwise specified).
- or both current user's and other participants' sides.
See the details in the methods' descriptions.
An executor on which all events will be received is specified via Voximplant.getClientInstance(Executor, Context, ClientConfig).
Methods
isRead
void isRead(IConversationServiceEvent event)
Invoked for all clients in the conversation as the result of IConversation.markAsRead(long, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Parameters
Event object with conversation UUID and service information
onCreateConversation
void onCreateConversation(IConversationEvent event)
Invoked when a conversation is created via IMessenger.createConversation(ConversationConfig, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation.
Parameters
event:
IConversationEventEvent object with conversation data and service information
onEditConversation
void onEditConversation(IConversationEvent event)
Invoked when the conversation properties were modified as the result of:
- IMessenger.joinConversation(String, IMessengerCompletionHandler)
- IMessenger.leaveConversation(String, IMessengerCompletionHandler)
- IConversation.update(IMessengerCompletionHandler)
- IConversation.addParticipants(List, IMessengerCompletionHandler)
- IConversation.removeParticipants(List, IMessengerCompletionHandler)
- IConversation.editParticipants(List, IMessengerCompletionHandler)
- or analogous methods from other Voximplant SDKs and Messaging API
Triggered only for participants that belong to the conversation.
Parameters
event:
IConversationEventEvent object with conversation data and service information
onEditMessage
void onEditMessage(IMessageEvent event)
Invoked when a message was edited via IMessage.update(String, List, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation with the changed message.
Parameters
event:
IMessageEventEvent object with message data and service information
onEditUser
void onEditUser(IUserEvent event)
Invoked as the result of IMessenger.editUser(Map, Map, IMessengerCompletionHandler), IMessenger.managePushNotifications(List, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for the subscribers of the changed user. Use IMessenger.subscribe(List, IMessengerCompletionHandler) to subscribe for user's changes.
Parameters
event:
IUserEventEvent object with user data and service information
onError
void onError(IErrorEvent event)
Invoked when an error occurred as the result of any Voximplant Android Messaging API methods call.
Triggered only on the current user's side.
Parameters
event:
IErrorEventEvent object with error details and service information
onGetConversation
void onGetConversation(IConversationEvent event)
Invoked when a conversation description is received as the result of the IMessenger.getConversation(String, IMessengerCompletionHandler) or IMessenger.getConversations(List, IMessengerCompletionHandler) methods calls.
Triggered only on the current user's side.
Parameters
event:
IConversationEventEvent object with conversation data and service information
onGetPublicConversations
void onGetPublicConversations(IConversationListEvent event)
Invoked when the list of public conversations UUIDs is received as the result of the IMessenger.getPublicConversations(IMessengerCompletionHandler) method call.
Triggered only on the current user's side.
Parameters
event:
IConversationListEventEvent object with public conversations UUIDs and service information
onGetSubscriptionList
void onGetSubscriptionList(ISubscriptionEvent event)
Invoked as the result of the IMessenger.getSubscriptionList(IMessengerCompletionHandler) method call.
Triggered only on the current user's side.
Parameters
event:
ISubscriptionEventEvent object with subscription data and service information
onGetUser
void onGetUser(IUserEvent event)
Invoked as the result of:
- IMessenger.getUser(long, IMessengerCompletionHandler)
- IMessenger.getUser(String, IMessengerCompletionHandler)
- IMessenger.getUsersByIMId(List, IMessengerCompletionHandler)
- IMessenger.getUsersByName(List, IMessengerCompletionHandler)
Triggered only on the current user's side.
Parameters
event:
IUserEventEvent object with user data and service information
onRemoveConversation
void onRemoveConversation(IConversationEvent event)
Invoked when a conversation was removed.
Note that removing is possible via Voximplant Messaging API only.
Triggered only for participants that belong to the conversation.
Parameters
event:
IConversationEventEvent object with conversation data and service info
onRemoveMessage
void onRemoveMessage(IMessageEvent event)
Invoked when a message was removed from a conversation via IMessage.remove(IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation with the deleted message.
Parameters
event:
IMessageEventEvent object with message data and service information
onRetransmitEvents
void onRetransmitEvents(IRetransmitEvent event)
Invoked as the result of the following methods calls on some conversation for this SDK instance:
- IConversation.retransmitEvents(long, long, IMessengerCompletionHandler),
- IConversation.retransmitEventsFrom(long, int, IMessengerCompletionHandler),
- IConversation.retransmitEventsTo(long, int, IMessengerCompletionHandler)
Triggered only on the current user's side.
Parameters
event:
IRetransmitEventEvent object with retransmitted events and service information
onSendMessage
void onSendMessage(IMessageEvent event)
Invoked when a new message was sent to a conversation via IConversation.sendMessage(String, List, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation.
Parameters
event:
IMessageEventEvent object with message data and service information
onSetStatus
void onSetStatus(IStatusEvent event)
Invoked after a user status was changed via IMessenger.setStatus(boolean, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for the subscribers of the changed user. Use IMessenger.subscribe(List, IMessengerCompletionHandler) to subscribe for a user's changes.
Parameters
event:
IStatusEventEvent object with user status data and service information
onSubscribe
void onSubscribe(ISubscriptionEvent event)
Invoked as the result of IMessenger.subscribe(List, IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered on all logged in clients of the current user
Parameters
event:
ISubscriptionEventEvent object with subscription data and service information
onTyping
void onTyping(IConversationServiceEvent event)
Invoked when some user is typing text in a conversation. Information about typing is received via IConversation.typing(IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered only for participants that belong to the conversation where typing is performing.
Parameters
Event object with conversation UUID and service information
onUnsubscribe
void onUnsubscribe(ISubscriptionEvent event)
Invoked as the result of IMessenger.unsubscribe(List, IMessengerCompletionHandler), IMessenger.unsubscribeFromAll(IMessengerCompletionHandler) or analogous methods from other Voximplant SDKs and Messaging API.
Triggered on all logged in clients of the current user.
Parameters
event:
ISubscriptionEventEvent object with subscription data and service information