Class PushAction

java.lang.Object
com.codename1.push.PushAction

public class PushAction extends Object
Encapsulates a push notification action. Available actions for a push notification are defined by the PushActionsProvider#getPushActionCategories() implementation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new push action
    PushAction(String id, String title)
    Creates a new push action
    PushAction(String id, String title, String icon)
    Creates a new push action
    PushAction(String id, String title, String icon, String textInputPlaceholder, String textInputButtonText)
    Creates a new push action
  • Method Summary

    Modifier and Type
    Method
    Description
    The icon of the action.
    Gets the ID of the action.
    The button label for the "reply" button on the text input field.
    The placeholder text to use for text input on this action.
    The title of the action.

    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

    • PushAction

      public PushAction(String id, String title, String icon)

      Creates a new push action

      Parameters
      • id: @param id The ID of the action. This is the id that will be available in PushContent#getActionId() if the user selected this action on the push notification.

      • title: The title of the action. This is the button label in the push notification.

      • icon: Icon for the action. Not supported currently on most platforms.

    • PushAction

      public PushAction(String id, String title, String icon, String textInputPlaceholder, String textInputButtonText)

      Creates a new push action

      Parameters
      • id: @param id The ID of the action. This is the id that will be available in PushContent#getActionId() if the user selected this action on the push notification.

      • title: The title of the action. This is the button label in the push notification.

      • icon: Icon for the action. Not supported currently on most platforms.

      • textInputPlaceholder: Placeholder text to use for the text input field.

      • textInputButtonText: Text to be used for the "reply" button in the text input field.

    • PushAction

      public PushAction(String id, String title)

      Creates a new push action

      Parameters
      • id: @param id The ID of the action. This is the id that will be available in PushContent#getActionId() if the user selected this action on the push notification.

      • title: The title of the action. This is the button label in the push notification.

    • PushAction

      public PushAction(String title)

      Creates a new push action

      Parameters
      • title: The title and id of the action. This is the button label in the push notification.
  • Method Details

    • getId

      public String getId()

      Gets the ID of the action. This is the value that will be made available inside the PushCallback#push(java.lang.String) method via PushContent#getActionId() if the user selects this action in a push notification.

      Returns

      the id The ID of the action.

      See also
      • PushContent#getActionId()
    • getTitle

      public String getTitle()

      The title of the action. This will be the label for the action's button in the push notification.

      Returns

      the title The title of the action.

    • getIcon

      public String getIcon()

      The icon of the action. Not supported yet on most platforms.

      Returns

      the icon The icon for the action.

    • getTextInputPlaceholder

      public String getTextInputPlaceholder()

      The placeholder text to use for text input on this action. Either #textInputButtonText or #textInputPlaceholder must be non-null for the action to include a text input.

      Returns

      the textInputPlaceholder

    • getTextInputButtonText

      public String getTextInputButtonText()

      The button label for the "reply" button on the text input field. Either #textInputButtonText or #textInputPlaceholder must be non-null for the action to include a text input.

      Returns

      the textInputButtonText