Rate this page:

MessengerListener

This API is in beta and subject to change.

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 are received is specified via com.voximplant.android.sdk.core.ClientConfig.callbackExecutor.

Methods

onGetUser

Copy URL
fun onGetUser(event: 

UserEvent

):

Unit

This API is in beta and subject to change.

Triggered as the result of:

Triggered only on the current user's side.

Parameters

  • event:

    UserEvent

    Event object with user data and service information

Returns

  • type:

    Unit

onEditUser

Copy URL
fun onEditUser(event: 

UserEvent

):

Unit

This API is in beta and subject to change.

Triggered as the result of Messenger.editUser, Messenger.managePushNotifications or analogous methods from other Voximplant SDKs and Messaging API.

Triggered only for the subscribers of the changed user. Use Messenger.subscribe to subscribe for user's changes.

Parameters

  • event:

    UserEvent

    Event object with user data and service information

Returns

  • type:

    Unit

onSubscribe

Copy URL
fun onSubscribe(event: 

SubscriptionEvent

):

Unit

This API is in beta and subject to change.

Triggered as the result of Messenger.subscribe or analogous methods from other Voximplant SDKs and Messaging API.

Triggered on all logged in clients of the current user

Parameters

Returns

  • type:

    Unit

onUnsubscribe

Copy URL
fun onUnsubscribe(event: 

SubscriptionEvent

):

Unit

This API is in beta and subject to change.

Triggered as the result of Messenger.unsubscribe, Messenger.unsubscribeFromAll or analogous methods from other Voximplant SDKs and Messaging API.

Triggered on all logged in clients of the current user.

Parameters

Returns

  • type:

    Unit

onGetSubscriptionList

Copy URL
fun onGetSubscriptionList(event: 

SubscriptionEvent

):

Unit

This API is in beta and subject to change.

Triggered as the result of the Messenger.getSubscriptionList method call.

Triggered only on the current user's side.

Parameters

Returns

  • type:

    Unit

onCreateConversation

Copy URL
fun onCreateConversation(event: 

ConversationEvent

):

Unit

This API is in beta and subject to change.

Triggered when a conversation is created via Messenger.createConversation or analogous methods from other Voximplant SDKs and Messaging API.

Triggered only for participants that belong to the conversation.

Parameters

Returns

  • type:

    Unit

onRemoveConversation

Copy URL
fun onRemoveConversation(event: 

ConversationEvent

):

Unit

This API is in beta and subject to change.

Triggered when a conversation is removed.

Note that removing is possible via Voximplant Messaging API only.

Triggered only for participants that belong to the conversation.

Parameters

Returns

  • type:

    Unit

onGetConversation

Copy URL
fun onGetConversation(event: 

ConversationEvent

):

Unit

This API is in beta and subject to change.

Triggered when a conversation description is received as the result of the Messenger.getConversation or Messenger.getConversations methods calls.

Triggered only on the current user's side.

Parameters

Returns

  • type:

    Unit

onGetPublicConversations

Copy URL
fun onGetPublicConversations(event: 

ConversationListEvent

):

Unit

This API is in beta and subject to change.

Triggered when the list of public conversations UUIDs is received as the result of the Messenger.getPublicConversations method call.

Triggered only on the current user's side.

Parameters

Returns

  • type:

    Unit

onEditConversation

Copy URL
fun onEditConversation(event: 

ConversationEvent

):

Unit

This API is in beta and subject to change.

Triggered when the conversation properties are modified as the result of:

Triggered only for participants that belong to the conversation.

Parameters

Returns

  • type:

    Unit

onSetStatus

Copy URL
fun onSetStatus(event: 

StatusEvent

):

Unit

This API is in beta and subject to change.

Triggered after a user status is changed via Messenger.setStatus or analogous methods from other Voximplant SDKs and Messaging API.

Triggered only for the subscribers of the changed user. Use Messenger.subscribe to subscribe for a user's changes.

Parameters

  • Event object with user status data and service information

Returns

  • type:

    Unit

onEditMessage

Copy URL
fun onEditMessage(event: 

MessageEvent

):

Unit

This API is in beta and subject to change.

Triggered when a message is edited via Message.update 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 object with message data and service information

Returns

  • type:

    Unit

onSendMessage

Copy URL
fun onSendMessage(event: 

MessageEvent

):

Unit

This API is in beta and subject to change.

Triggered when a new message is sent to a conversation via Conversation.sendMessage or analogous methods from other Voximplant SDKs and Messaging API.

Triggered only for participants that belong to the conversation.

Parameters

  • Event object with message data and service information

Returns

  • type:

    Unit

onRemoveMessage

Copy URL
fun onRemoveMessage(event: 

MessageEvent

):

Unit

This API is in beta and subject to change.

Triggered when a message is removed from a conversation via Message.remove 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 object with message data and service information

Returns

  • type:

    Unit

onTyping

Copy URL
fun onTyping(event: 

ConversationServiceEvent

):

Unit

This API is in beta and subject to change.

Triggered when some user is typing text in a conversation. Information about typing is received via Conversation.typing or analogous methods from other Voximplant SDKs and Messaging API.

Triggered only for participants that belong to the conversation where typing is performing.

Parameters

Returns

  • type:

    Unit

isRead

Copy URL
fun isRead(event: 

ConversationServiceEvent

):

Unit

This API is in beta and subject to change.

Triggered for all clients in the conversation as the result of Conversation.markAsRead or analogous methods from other Voximplant SDKs and Messaging API.

Parameters

Returns

  • type:

    Unit

onError

Copy URL
fun onError(event: 

ErrorEvent

):

Unit

This API is in beta and subject to change.

Triggered 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 object with error details and service information

Returns

  • type:

    Unit

onRetransmitEvents

Copy URL
fun onRetransmitEvents(event: 

RetransmitEvent

):

Unit

This API is in beta and subject to change.

Triggered as the result of the following methods calls on some conversation for this SDK instance:

Triggered only on the current user's side.

Parameters

  • Event object with retransmitted events and service information

Returns

  • type:

    Unit