-
- All Implemented Interfaces:
-
apptentive.com.android.feedback.lifecycle.LifecycleListener,apptentive.com.android.feedback.message.ConversationListener
public final class MessageManager implements LifecycleListener, ConversationListenerThis class acts as a communicator between MessageCenterModule & Apptentive core components It owns PollingScheduler,schedules and updates the polling Configuration depending on whether the App & MessageCenter is in the background vs foreground Fetches,sorts & groups messages Updates & maintain the cache using MessageRepository Sends & download attachments Supports hidden messages Provides UnreadMessageCallback to notify new unread messages to the app
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String, Object>messageCustomDataprivate BooleanisLoggedOutprivate final PollingSchedulerpollingSchedulerprivate final Observable<List<Message>>messagesprivate final Observable<Person>profile
-
Constructor Summary
Constructors Constructor Description MessageManager(MessageCenterService messageCenterService, Executor serialExecutor, MessageRepository messageRepository)
-
Method Summary
-
-
Constructor Detail
-
MessageManager
MessageManager(MessageCenterService messageCenterService, Executor serialExecutor, MessageRepository messageRepository)
-
-
Method Detail
-
getMessageCustomData
final Map<String, Object> getMessageCustomData()
-
setMessageCustomData
final Unit setMessageCustomData(Map<String, Object> messageCustomData)
-
getIsLoggedOut
final Boolean getIsLoggedOut()
-
setIsLoggedOut
final Unit setIsLoggedOut(Boolean isLoggedOut)
-
getPollingScheduler
final PollingScheduler getPollingScheduler()
-
getMessages
final Observable<List<Message>> getMessages()
-
getProfile
final Observable<Person> getProfile()
-
onAppBackground
Unit onAppBackground()
-
onAppForeground
Unit onAppForeground()
-
onConversationChanged
Unit onConversationChanged(Conversation conversation)
-
resetForAnonymousToLogin
final Unit resetForAnonymousToLogin()
-
setCustomData
final Unit setCustomData(Map<String, Object> customData)
-
fetchMessages
final Unit fetchMessages()
-
sendMessage
final Unit sendMessage(String messageText, List<Message.Attachment> attachments, Boolean isHidden)
-
sendMessage
final Unit sendMessage(Message message)
-
updateProfile
final Unit updateProfile(String name, String email)
-
updateMessages
final Unit updateMessages(List<Message> messages)
-
sendAttachment
final Unit sendAttachment(String uri, Boolean isHidden)
-
sendHiddenAttachmentFromInputStream
final Unit sendHiddenAttachmentFromInputStream(InputStream inputStream, String mimeType)
-
downloadAttachment
final Unit downloadAttachment(Activity activity, Message message, Message.Attachment attachment)
-
onMessageCenterLaunchStatusChanged
final Unit onMessageCenterLaunchStatusChanged(Boolean isActive)
-
getAllMessages
final List<Message> getAllMessages()
-
getUnreadMessageCount
final Integer getUnreadMessageCount()
-
addUnreadMessageListener
final Unit addUnreadMessageListener(Function0<Unit> callback)
-
updateMessageStatus
final Unit updateMessageStatus(Boolean isSuccess, PayloadData payloadData)
-
-
-
-