Interface ConversationDelegate

  • All Known Implementing Classes:
    ConversationActivity, ConversationDelegateAdapter

    public interface ConversationDelegate
    Delegate for events related to the conversation.

    Creating a delegate is optional, and may be used to receive callbacks when important changes happen in the conversation.

    Callbacks are guaranteed to be called from the main thread.

    • Method Detail

      • onMessagesReceived

        void onMessagesReceived​(Conversation conversation,
                                java.util.List<Message> messages)
        Notifies the delegate of new incoming messages.

        Called when new messages are received from the server.

        Parameters:
        conversation - The conversation object.
        messages - A list of Message objects representing the new messages.
      • onMessagesReset

        void onMessagesReset​(Conversation conversation,
                             java.util.List<Message> messages)
        Notifies the delegate the messages in a conversation have been reset.

        Called when new messages are received from the server that do not match locally stored cache or if a different conversation was loaded.

        Parameters:
        conversation - The conversation object.
        messages - A list of Message objects representing the new messages.
      • onUnreadCountChanged

        void onUnreadCountChanged​(Conversation conversation,
                                  int unreadCount)
        Notifies the delegate of a change in unread message count.

        Called when conversation data is fetched from the server, or when the user enters the conversation activity.

        Parameters:
        conversation - The conversation object
        unreadCount - The count of unread messages
      • onMessageSent

        void onMessageSent​(Message message,
                           MessageUploadStatus status)
        Notifies the delegate of a message being sent.

        Called once the message has been sent successfully or not.

        Parameters:
        message - The message that was sent
        status - The status of the message that was sent
        See Also:
        MessageUploadStatus
      • onConversationEventReceived

        void onConversationEventReceived​(ConversationEvent conversationActivity)
        Notifies the delegate of a new activity.

        Called when a new activity is received from the server

        Parameters:
        conversationActivity - The conversationActivity that was received
        See Also:
        ConversationEventType
      • onInitializationStatusChanged

        void onInitializationStatusChanged​(InitializationStatus status)
        Notifies the delegate of a change in Initialization status.

        Parameters:
        status - The new status
        See Also:
        InitializationStatus
      • onPaymentProcessed

        void onPaymentProcessed​(MessageAction messageAction,
                                PaymentStatus status)
        Notifies the delegate when payment is processed.

        Parameters:
        messageAction - The purchased message action
        status - The status of the payment
        See Also:
        MessageAction, PaymentStatus
      • shouldTriggerAction

        boolean shouldTriggerAction​(MessageAction messageAction)
        Allows a delegate to override default action behavior.

        Called when the user taps a message action.

        Parameters:
        messageAction - The message action that was tapped.
        Returns:
        false to prevent default behaviour of message action click, true otherwise
        See Also:
        MessageAction
      • onCardSummaryLoaded

        void onCardSummaryLoaded​(CardSummary cardSummary)
        Notifies the delegate when a saved stripe card is loaded.

        Called when the stripe card info is loaded.

        Parameters:
        cardSummary - The stripe card information.
        See Also:
        CardSummary
      • onSmoochConnectionStatusChanged

        void onSmoochConnectionStatusChanged​(SmoochConnectionStatus status)
        Notifies the delegate when the user's connection to Smooch has changed.

        Called when the user's connection to Smooch changes.

        Parameters:
        status - The connection status.
        See Also:
        SmoochConnectionStatus
      • onSmoochShown

        void onSmoochShown()
        Notifies the delegate when the Smooch Conversation is shown.
      • onSmoochHidden

        void onSmoochHidden()
        Notifies the delegate when the Smooch Conversation is hidden.
      • onConversationsListUpdated

        void onConversationsListUpdated​(java.util.List<Conversation> conversationsList)
        Notifies the delegate when the conversations list was updated. If you are building your own conversation list UI, implement this method to receive updates on any conversations in the list for this user
        Parameters:
        conversationsList - an updated list of Conversation