Enum Class PushPermission
- All Implemented Interfaces:
Serializable, Comparable<PushPermission>, Constable
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
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe user refused notifications; only the user can change that, in the browser's or the operating system's settings.The user allowed notifications.The user has not decided; a subscribe will show the permission prompt.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 Summary
Modifier and TypeMethodDescriptionstatic PushPermissionReturns the enum constant of this class with the specified name.static PushPermission[]values()Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
PROMPT
The user has not decided; a subscribe will show the permission prompt. The browser's"default"or"prompt".GRANTED
The user allowed notifications. The browser's"granted".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
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
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
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 nameNullPointerException- if the argument is null