Class EventService

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

public class EventService
extends Object
  • Constructor Details

  • Method Details

    • sendEvent

      public void sendEvent​(String toProfileId, String eventType, String jsonEventData, IServerCallback callback)
      Sends an event to the designated player id with the attached json data. Any events that have been sent to a player will show up in their incoming event mailbox. If the recordLocally flag is set to true, a copy of this event (with the exact same event id) will be stored in the sending player's "sent" event mailbox. Note that the list of sent and incoming events for a player is returned in the "ReadPlayerState" call (in the BrainCloudPlayer module). Service Name - event Service Operation - SEND
      Parameters:
      toProfileId - The id of the user who is being sent the event
      eventType - The user-defined type of the event.
      jsonEventData - The user-defined data for this event encoded in JSON.
      callback - The callback.
    • updateIncomingEventData

      public void updateIncomingEventData​(String evId, String jsonEventData, IServerCallback callback)
      Updates an event in the player's incoming event mailbox. Service Name - event Service Operation - UPDATE_EVENT_DATA
      Parameters:
      evId - The event id
      jsonEventData - The user-defined data for this event encoded in JSON.
      callback - The callback.
    • updateIncomingEventDataIfExists

      public void updateIncomingEventDataIfExists​(String evId, String jsonEventData, IServerCallback callback)
      Updates an event in the player's incoming event mailbox. Returns the same data as updateIncomingEventData, but will not return an error if the event does not exist. Service Name - event Service Operation - UPDATE_EVENT_DATA_IF_EXISTS
      Parameters:
      evId - The event id
      jsonEventData - The user-defined data for this event encoded in JSON.
      callback - The callback.
    • deleteIncomingEvent

      public void deleteIncomingEvent​(String evId, IServerCallback callback)
      Delete an event out of the player's incoming mailbox. Service Name - event Service Operation - DELETE_INCOMING
      Parameters:
      evId - The event id
      callback - The callback.
    • deleteIncomingEvents

      public void deleteIncomingEvents​(String[] evIds, IServerCallback callback)
      Delete a list of events out of the user's incoming mailbox. Service Name - event Service Operation - DELETE_INCOMING_EVENTS
      Parameters:
      evIds - Collection of event ids
      callback - The callback.
    • deleteIncomingEventsByTypeOlderThan

      public void deleteIncomingEventsByTypeOlderThan​(String eventType, long dateMillis, IServerCallback callback)
      Delete any events of the given type older than the given date out of the user's incoming mailbox. Service Name - event Service Operation - DELETE_INCOMING_EVENTS_BY_TYPE_OLDER_THAN
      Parameters:
      eventType - The user-defined type of the event
      dateMillis - createdAt cut-off time whereby older events will be deleted
      callback - The callback.
    • deleteIncomingEventsOlderThan

      public void deleteIncomingEventsOlderThan​(long dateMillis, IServerCallback callback)
      Delete any events older than the given date out of the user's incoming mailbox. Service Name - event Service Operation - DELETE_INCOMING_EVENTS_OLDER_THAN
      Parameters:
      dateMillis - createdAt cut-off time whereby older events will be deleted
      callback - The callback.
    • getEvents

      public void getEvents​(IServerCallback callback)
      Get the events currently queued for the player. Service Name - event Service Operation - GET_EVENTS
      Parameters:
      callback - The method to be invoked when the server response is received