Class RequestWebNotificationPermissionAction

java.lang.Object
com.vaadin.flow.component.trigger.internal.Action
com.vaadin.flow.component.trigger.internal.RequestWebNotificationPermissionAction
All Implemented Interfaces:
Serializable

public class RequestWebNotificationPermissionAction extends Action
Asks the browser for permission to show notifications when the bound trigger fires.

Browsers only show the permission prompt during a user gesture (a click, a key press, …), so bind this action to a Trigger that fires during such a gesture, typically a ClickTrigger. The outcome is not reported through this action: the client publishes the new permission to the UI's permission signal, which also covers changes made outside the prompt.

For internal use only. May be renamed or removed in a future release.

See Also:
  • Constructor Details

    • RequestWebNotificationPermissionAction

      public RequestWebNotificationPermissionAction()
  • Method Details

    • toJs

      protected JsFunction toJs(Trigger trigger)
      Description copied from class: Action
      Builds the JsFunction that runs this action when the surrounding trigger fires. The returned function takes one runtime argument named event (declared by the framework when it composes the trigger handler); subclasses do not declare argument names themselves.

      The body is one statement. To embed a value produced on the client, capture an Action.Input's JsFunction as a capture and invoke it inside the body as $N(event).

      Specified by:
      toJs in class Action
      Parameters:
      trigger - the surrounding trigger this render is for, not null
      Returns:
      the action's JS function, not null