Class PushActionCategory

java.lang.Object
com.codename1.push.PushActionCategory

public class PushActionCategory extends Object

Encapsulates a category for push notifications. If a push notification specifies a category, and the app's main class implements PushActionsProvider, then the push notification will provide a set of buttons to select among the actions available for that category. If the user selects an action in the push notification, their choice will be made available inside the PushCallback#push(java.lang.String) method via the PushContent#getActionId() method.

Applications that wish to support actions must implement PushActionsProvider in its main class. The PushActionsProvider#getPushActionCategories() implementation defines all of the categories that are available for push notifications.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a category with the specified actions.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the actions in this category.
    static PushAction[]
    Convenience method to return all of the actions in the provided categories.
    Gets the ID of the category.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Constructor Details

    • PushActionCategory

      public PushActionCategory(String id, PushAction... actions)

      Creates a category with the specified actions.

      Parameters
      • id: The ID of the category. Should correspond with the "category" of a push notification.

      • actions: The actions that are available for this category.

  • Method Details

    • getAllActions

      public static PushAction[] getAllActions(PushActionCategory... categories)

      Convenience method to return all of the actions in the provided categories.

      Parameters
      • categories: The categories from which to get actions.
      Returns

      List of actions in all of the provided categories.

    • getActions

      public PushAction[] getActions()
      Gets the actions in this category. These actions will be manifested as buttons in push notifications directed at this category.
    • getId

      public String getId()

      Gets the ID of the category. This corresponds with the category of a push notification.

      Returns

      the id

      See also
      • PushContent#getCategory()