IMessengerListener
Interface that provides API to handle messenger events.
Methods are triggered either on:
- the current user's side only. The events always triggered only on a client where messaging methods are called (unless otherwise specified).
- or both the current user's and other participants' sides.
See the details in the methods' descriptions.
An executor on which all events are received is specified via Voximplant.getClientInstance(Executor, Context, ClientConfig).
Methods
isRead
void
isRead( event)
Triggered 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)
Triggered if 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)
Triggered if the conversation properties have been 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)
Triggered if a message has been 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)
Triggered 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)
Triggered if 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)
Triggered if 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)
Triggered if 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)
Triggered 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)
Triggered 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)
Triggered if a conversation has been 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)
Triggered if a message has been 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)
Triggered 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)
Triggered if a new message has been 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)
Triggered if a user status has been 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)
Triggered 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)
Triggered if 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)
Triggered 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