Enum Class PushPermission

java.lang.Object
java.lang.Enum<PushPermission>
com.iizix.push.PushPermission
All Implemented Interfaces:
Serializable, Comparable<PushPermission>, Constable

public enum PushPermission extends Enum<PushPermission>
The notification permission of a device, as the device itself reports it.

The first three constants are the three values of the browser's Notification.permission and PushManager.permissionState(); FirebaseX reports the same three on Cordova.

Author:
Christopher Mindus
  • Enum Constant Details

    • PROMPT

      public static final PushPermission PROMPT
      The user has not decided; a subscribe will show the permission prompt. The browser's "default" or "prompt".
    • GRANTED

      public static final PushPermission GRANTED
      The user allowed notifications. The browser's "granted".
    • DENIED

      public static final PushPermission DENIED
      The user refused notifications; only the user can change that, in the browser's or the operating system's settings. The browser's "denied".
    • UNSUPPORTED

      public static final PushPermission UNSUPPORTED
      The device cannot receive Push Notification at all: a Browser without a Service Worker, the Push API or the Notification API, an iOS Safari page that is not a Home Screen web app, or a Cordova app without the FirebaseX plugin.
  • Method Details

    • values

      public static PushPermission[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PushPermission valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null