public static class

NotificationActionButton.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.push.notifications.NotificationActionButton.Builder

Class Overview

Builds the NotificationAction.

Summary

Public Constructors
Builder(String buttonId)
Set the buttonId.
Public Methods
NotificationActionButton.Builder addRemoteInput(LocalizableRemoteInput remoteInput)
Add a remoteInput.
NotificationActionButton build()
Builds and return the notification action.
NotificationActionButton.Builder extend(NotificationCompat.Action.Extender extender)
Extends the notification action.
NotificationActionButton.Builder setDescription(String description)
Sets the description of the action.
NotificationActionButton.Builder setIcon(int iconId)
Set the icon.
NotificationActionButton.Builder setLabel(int labelId)
Set the label from a string resource.
NotificationActionButton.Builder setLabel(String label)
Set the label.
NotificationActionButton.Builder setPerformsInForeground(boolean isForegroundAction)
Set the isForegroundAction flag.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder (String buttonId)

Set the buttonId.

Parameters
buttonId A string value.

Public Methods

public NotificationActionButton.Builder addRemoteInput (LocalizableRemoteInput remoteInput)

Add a remoteInput.

Parameters
remoteInput A LocalizableRemoteInput value.
Returns
  • The builder with the remoteInput value set.

public NotificationActionButton build ()

Builds and return the notification action.

Returns
  • The notification action.

public NotificationActionButton.Builder extend (NotificationCompat.Action.Extender extender)

Extends the notification action.

Parameters
extender A NotificationCompat.Action.Extender value.
Returns
  • The builder with the extender value added.

public NotificationActionButton.Builder setDescription (String description)

Sets the description of the action. Used for analytics.

Parameters
description The action description.
Returns
  • The builder with the description set.

public NotificationActionButton.Builder setIcon (int iconId)

Set the icon.

Note: All notification icons should be entirely white on a transparent background.

Parameters
iconId An int value.
Returns
  • The builder with the iconId value set.

public NotificationActionButton.Builder setLabel (int labelId)

Set the label from a string resource.

Parameters
labelId An int value.
Returns
  • The builder instance.

public NotificationActionButton.Builder setLabel (String label)

Set the label.

Parameters
label The label.
Returns
  • The builder instance.

public NotificationActionButton.Builder setPerformsInForeground (boolean isForegroundAction)

Set the isForegroundAction flag. Defaults to true.

Parameters
isForegroundAction A boolean value.
Returns
  • The builder with the isForegroundAction value set.