Class BatchNotificationAction


  • public class BatchNotificationAction
    extends java.lang.Object
    Represents a Notification Action button
    • Field Summary

      Fields 
      Modifier and Type Field Description
      JSONObject actionArguments
      Action
      java.lang.String actionIdentifier
      Action identifier.
      java.lang.String drawableName
      CTA Drawable name.
      boolean hasUserInterface
      Does this action imply showing any UI or will it act in the background? An action that has no UI should not close the notification drawer, but should still dismiss the notification itself (if asked to).
      java.lang.String label
      CTA label text
      boolean shouldDismissNotification
      Should a tap on this action dismiss its notification?
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<androidx.core.app.NotificationCompat.Action> getSupportActions​(android.content.Context context, java.util.List<BatchNotificationAction> batchActions, BatchPushPayload pushPayload, java.lang.Integer notificationId)
      Converts BatchNotificationAction instances to NotificationCompat.Action, allowing you to add actions to a Notification the same way the SDK internally does it, taking care of all the boilerplate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • label

        public java.lang.String label
        CTA label text
      • actionIdentifier

        public java.lang.String actionIdentifier
        Action identifier. Made to work with Batch.Actions
      • actionArguments

        public JSONObject actionArguments
        Action
      • hasUserInterface

        public boolean hasUserInterface
        Does this action imply showing any UI or will it act in the background? An action that has no UI should not close the notification drawer, but should still dismiss the notification itself (if asked to).
    • Constructor Detail

      • BatchNotificationAction

        public BatchNotificationAction()
    • Method Detail

      • getSupportActions

        @NonNull
        public static java.util.List<androidx.core.app.NotificationCompat.Action> getSupportActions​(@NonNull
                                                                                                    android.content.Context context,
                                                                                                    @NonNull
                                                                                                    java.util.List<BatchNotificationAction> batchActions,
                                                                                                    @Nullable
                                                                                                    BatchPushPayload pushPayload,
                                                                                                    @Nullable
                                                                                                    java.lang.Integer notificationId)
        Converts BatchNotificationAction instances to NotificationCompat.Action, allowing you to add actions to a Notification the same way the SDK internally does it, taking care of all the boilerplate.

        Parameters:
        context - Your application's context
        batchActions - List of BatchNotificationAction instances to convert
        pushPayload - The Batch push payload associated with these actions, if any. If not set, the UserActionSource will not be set when your custom UserActionRunnable is called. This parameter might be required for some internal actions.
        notificationId - The Id of the notification these actions will be attached to. Required for shouldDismissNotification to work.
        Returns:
        A list of NotificationCompat.Action instances matching the provided BatchNotificationAction, if they've been successfully converted