Package com.bitheads.braincloud.services
Class MessagingService
java.lang.Object
com.bitheads.braincloud.services.MessagingService
Created by David St-Louis on 2018-07-17
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteMessages(String msgbox, ArrayList<String> msgIds, IServerCallback callback) Deletes specified user messages on the server.voidgetMessageboxes(IServerCallback callback) Retrieve user's message boxes, including 'inbox', 'sent', etc.voidgetMessageCounts(IServerCallback callback) Returns count of user's 'total' messages and their 'unread' messages.voidgetMessages(String msgbox, ArrayList<String> msgIds, Boolean markAsRead, IServerCallback callback) Retrieves list of specified messages.voidgetMessagesPage(String context, IServerCallback callback) Retrieves a page of messages.voidgetMessagesPageOffset(String context, int pageOffset, IServerCallback callback) Gets the page of messages from the server based on the encoded context and specified page offset.voidmarkMessagesRead(String msgbox, ArrayList<String> msgIds, IServerCallback callback) Marks list of user messages as read on the server.voidsendMessage(ArrayList<String> toProfileIds, String contentJson, IServerCallback callback) Marks list of user messages as read on the server.voidsendMessageSimple(ArrayList<String> toProfileIds, String messageText, IServerCallback callback) Marks list of user messages as read on the server.
-
Constructor Details
-
MessagingService
-
-
Method Details
-
deleteMessages
Deletes specified user messages on the server. Service Name - Messaging Service Operation - DELETE_MESSAGES- Parameters:
msgbox- The msgbox that we are deleting messages frommsgIds- Array of message ids to delete.callback- The method to be invoked when the server response is received
-
getMessageboxes
Retrieve user's message boxes, including 'inbox', 'sent', etc. Service Name - Messaging Service Operation - GET_MESSAGE_BOXES- Parameters:
callback- The method to be invoked when the server response is received
-
getMessageCounts
Returns count of user's 'total' messages and their 'unread' messages. Service Name - Messaging Service Operation - GET_MESSAGE_COUNTS- Parameters:
callback- The method to be invoked when the server response is received
-
getMessages
public void getMessages(String msgbox, ArrayList<String> msgIds, Boolean markAsRead, IServerCallback callback) Retrieves list of specified messages. Service Name - Messaging Service Operation - GET_MESSAGES- Parameters:
msgbox- The messagebox that the messages reside inmsgIds- Arrays of message ids to get.markAsRead- Whether the messages should be marked as read once retrieved.callback- The method to be invoked when the server response is received
-
getMessagesPage
Retrieves a page of messages. Service Name - Messaging Service Operation - GET_MESSAGES_PAGE- Parameters:
context- A context object that controls the searchCriteria, pagination and sorting of the results to be returned.callback- The method to be invoked when the server response is received
-
getMessagesPageOffset
Gets the page of messages from the server based on the encoded context and specified page offset. Service Name - Messaging Service Operation - GET_MESSAGES_PAGE_OFFSET- Parameters:
context- Encoded context object returned by getMessagesPagepageOffset- Number of pages to go forward or backcallback- The method to be invoked when the server response is received- See Also:
-
sendMessage
public void sendMessage(ArrayList<String> toProfileIds, String contentJson, IServerCallback callback) Marks list of user messages as read on the server. Service Name - Messaging Service Operation - SEND_MESSAGE- Parameters:
toProfileIds- An array of recipients of the message.contentJson- The message content.callback- The method to be invoked when the server response is received
-
sendMessageSimple
public void sendMessageSimple(ArrayList<String> toProfileIds, String messageText, IServerCallback callback) Marks list of user messages as read on the server. Service Name - Messaging Service Operation - SEND_MESSAGE_SIMPLE- Parameters:
toProfileIds- An array of recipients of the message.messageText- The text to sendcallback- The method to be invoked when the server response is received
-
markMessagesRead
Marks list of user messages as read on the server. Service Name - Messaging Service Operation - MARK_MESSAGES_READ- Parameters:
msgbox- The box that the messages reside in.msgIds- An array of msgIds.callback- The method to be invoked when the server response is received
-