Class MessagingService

java.lang.Object
com.bitheads.braincloud.services.MessagingService

public class MessagingService
extends Object
Created by David St-Louis on 2018-07-17
  • Constructor Details

  • Method Details

    • deleteMessages

      public void deleteMessages​(String msgbox, ArrayList<String> msgIds, IServerCallback callback)
      Deletes specified user messages on the server. Service Name - Messaging Service Operation - DELETE_MESSAGES
      Parameters:
      msgbox - The msgbox that we are deleting messages from
      msgIds - Array of message ids to delete.
      callback - The method to be invoked when the server response is received
    • getMessageboxes

      public void getMessageboxes​(IServerCallback callback)
      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

      public void getMessageCounts​(IServerCallback callback)
      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 in
      msgIds - 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

      public void getMessagesPage​(String context, IServerCallback callback)
      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

      public void getMessagesPageOffset​(String context, int pageOffset, IServerCallback callback)
      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 getMessagesPage
      pageOffset - Number of pages to go forward or back
      callback - The method to be invoked when the server response is received
      See Also:
      getMessagesPage(String context, IServerCallback callback)
    • 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 send
      callback - The method to be invoked when the server response is received
    • markMessagesRead

      public void markMessagesRead​(String msgbox, ArrayList<String> msgIds, IServerCallback callback)
      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