Package io.smooch.core
Interface MessageModifierDelegate
-
public interface MessageModifierDelegateDelegate for events related to sending and displaying of specific messages.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessagebeforeDisplay(ConversationDetails conversationDetails, Message message)Allows a delegate to modify the contents of a message before it's displayed in the conversation view.MessagebeforeNotification(java.lang.String conversationId, Message message)Allows a delegate to modify the contents of a message before it's displayed in a notification.MessagebeforeSend(ConversationDetails conversationDetails, Message message)Allows a delegate to modify the contents of a message before sending to Smooch servers.
-
-
-
Method Detail
-
beforeSend
Message beforeSend(ConversationDetails conversationDetails, Message message)
Allows a delegate to modify the contents of a message before sending to Smooch servers.You should always return a message here. Returning null will result in a
NullPointerException.When the message type is
fileorimage, only the messagemetadatamay be updated. Other message properties such astypeortextwon't be considered.- Parameters:
conversationDetails- details of the conversation containing the message being sent.message- the message being sent.- Returns:
- the message, modified as required.
- See Also:
Message
-
beforeDisplay
Message beforeDisplay(ConversationDetails conversationDetails, Message message)
Allows a delegate to modify the contents of a message before it's displayed in the conversation view.- Parameters:
conversationDetails- details of the conversation containing the message being displayed.message- the message being displayed.- Returns:
- the message, modified as required or
nullto hide the message. - See Also:
Message
-
beforeNotification
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.- Parameters:
conversationId- the ID of the conversation the notification belongs to.message- the message being displayed in the notification.- Returns:
- the message, modified as required or
nullprevent the notification. - See Also:
Message
-
-