public static interface Conversation.Delegate
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.
Modifier and Type | Method and Description |
---|---|
void |
onCardSummaryLoaded(CardSummary cardSummary)
Notifies the delegate when a saved stripe card is loaded.
|
void |
onConversationEventReceived(ConversationEvent conversationActivity)
Notifies the delegate of a new activity.
|
void |
onInitializationStatusChanged(InitializationStatus status)
Notifies the delegate of a change in Initialization status.
|
void |
onLoginComplete(LoginResult result)
Notifies the delegate when a call to
Smooch.login(String, String, SmoochCallback) is complete |
void |
onLogoutComplete(LogoutResult result)
Notifies the delegate when a call to
Smooch.logout(SmoochCallback) is complete |
void |
onMessageSent(Message message,
MessageUploadStatus status)
Notifies the delegate of a message being sent.
|
void |
onMessagesReceived(Conversation conversation,
java.util.List<Message> messages)
Notifies the delegate of new incoming messages.
|
void |
onMessagesReset(Conversation conversation,
java.util.List<Message> messages)
Notifies the delegate the messages in a conversation have been reset.
|
void |
onPaymentProcessed(MessageAction messageAction,
PaymentStatus status)
Notifies the delegate when payment is processed.
|
void |
onSmoochConnectionStatusChanged(SmoochConnectionStatus status)
Notifies the delegate when the user's connection to Smooch has changed.
|
void |
onSmoochHidden()
Notifies the delegate when the Smooch Conversation is hidden.
|
void |
onSmoochShown()
Notifies the delegate when the Smooch Conversation is shown.
|
void |
onUnreadCountChanged(Conversation conversation,
int unreadCount)
Notifies the delegate of a change in unread message count.
|
boolean |
shouldTriggerAction(MessageAction messageAction)
Allows a delegate to override default action behavior.
|
void onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
Called when new messages are received from the server.
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.void onUnreadCountChanged(Conversation conversation, int unreadCount)
Called when conversation data is fetched from the server, or when the user enters the conversation activity.
conversation
- The conversation objectunreadCount
- The count of unread messagesvoid onMessagesReset(Conversation conversation, java.util.List<Message> messages)
Called when new messages are received from the server that do not match locally stored cache.
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.void onMessageSent(Message message, MessageUploadStatus status)
Called once the message has been sent successfully or not.
message
- The message that was sentstatus
- The status of the message that was sentMessageUploadStatus
void onConversationEventReceived(ConversationEvent conversationActivity)
Called when a new activity is received from the server
conversationActivity
- The conversationActivity that was receivedConversationEventType
void onInitializationStatusChanged(InitializationStatus status)
status
- The new statusInitializationStatus
void onLoginComplete(LoginResult result)
Smooch.login(String, String, SmoochCallback)
is completeresult
- The login resultLoginResult
void onLogoutComplete(LogoutResult result)
Smooch.logout(SmoochCallback)
is completeresult
- The logout resultLogoutResult
void onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
messageAction
- The purchased message actionstatus
- The status of the paymentMessageAction
,
PaymentStatus
boolean shouldTriggerAction(MessageAction messageAction)
Called when the user taps a message action.
messageAction
- The message action that was tapped.MessageAction
void onCardSummaryLoaded(CardSummary cardSummary)
Called when the stripe card info is loaded.
cardSummary
- The stripe card information.CardSummary
void onSmoochConnectionStatusChanged(SmoochConnectionStatus status)
Called when the user's connection to Smooch changes.
status
- The connection status.SmoochConnectionStatus
void onSmoochShown()
void onSmoochHidden()