public interface MessageModifierDelegate
Creating a delegate is optional, and can be used to implement callbacks when messages are sent
or received. Setting this delegate can have large consequences on the way messages are
displayed to the user. When setting MessageModifierDelegate, all delegate methods
must be implemented as per their documentation.
| Modifier and Type | Method and Description |
|---|---|
Message |
beforeDisplay(ConversationDetails conversationDetails,
Message message)
Allows a delegate to modify the contents of a message before it's displayed in the conversation view.
|
Message |
beforeNotification(java.lang.String conversationId,
Message message)
Allows a delegate to modify the contents of a message before it's displayed in a notification.
|
Message |
beforeSend(ConversationDetails conversationDetails,
Message message)
Allows a delegate to modify the contents of a message before sending to BrandMessenger servers.
|
Message beforeSend(ConversationDetails conversationDetails, Message message)
You should always return a message here. Returning null will result in a NullPointerException.
When the message type is file or image, only the message
metadata may be updated. Other message properties such as type
or text won't be considered.
conversationDetails - details of the conversation containing the message being sent.message - the message being sent.MessageMessage beforeDisplay(ConversationDetails conversationDetails, Message message)
conversationDetails - details of the conversation containing the message being displayed.message - the message being displayed.null to hide the message.MessageMessage beforeNotification(java.lang.String conversationId, Message message)
conversationId - the ID of the conversation the notification belongs to.message - the message being displayed in the notification.null prevent the notification.Message