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( 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
Returns
type:
void
onCreateConversation
void
onCreateConversation( 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:
Event object with conversation data and service information
Returns
type:
void
onEditConversation
void
onEditConversation( 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:
Event object with conversation data and service information
Returns
type:
void
onEditMessage
void
onEditMessage( 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:
Event object with message data and service information
Returns
type:
void
onEditUser
void
onEditUser( 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:
Event object with user data and service information
Returns
type:
void
onError
void
onError( 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:
Event object with error details and service information
Returns
type:
void
onGetConversation
void
onGetConversation( 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:
Event object with conversation data and service information
Returns
type:
void
onGetPublicConversations
void
onGetPublicConversations( 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:
Event object with public conversations UUIDs and service information
Returns
type:
void
onGetSubscriptionList
void
onGetSubscriptionList( event)
Invoked as the result of the IMessenger.getSubscriptionList(IMessengerCompletionHandler) method call.
Triggered only on the current user's side.
Parameters
event:
Event object with subscription data and service information
Returns
type:
void
onGetUser
void
onGetUser( 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:
Event object with user data and service information
Returns
type:
void
onRemoveConversation
void
onRemoveConversation( 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:
Event object with conversation data and service info
Returns
type:
void
onRemoveMessage
void
onRemoveMessage( 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:
Event object with message data and service information
Returns
type:
void
onRetransmitEvents
void
onRetransmitEvents( 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:
Event object with retransmitted events and service information
Returns
type:
void
onSendMessage
void
onSendMessage( 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:
Event object with message data and service information
Returns
type:
void
onSetStatus
void
onSetStatus( 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:
Event object with user status data and service information
Returns
type:
void
onSubscribe
void
onSubscribe( 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:
Event object with subscription data and service information
Returns
type:
void
onTyping
void
onTyping( 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
Returns
type:
void
onUnsubscribe
void
onUnsubscribe( 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:
Event object with subscription data and service information
Returns
type:
void