# Class NotificationPermissionResult

java.lang.Object
com.codename1.notifications.NotificationPermissionResult

public class NotificationPermissionResult extends java.lang.Object

The result of a notification permission request delivered to a `NotificationPermissionCallback`. It exposes the granular authorization level the platform returned.

The levels mirror the iOS `UNAuthorizationStatus` values. On platforms with only a binary granted/denied model (such as Android) the level is either `AuthorizationLevel#AUTHORIZED` or `AuthorizationLevel#DENIED`.

##### See also

- NotificationPermissionCallback

- NotificationPermissionRequest

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `NotificationPermissionResult.AuthorizationLevel`
  The granular authorization level returned by the platform.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NotificationPermissionResult(NotificationPermissionResult.AuthorizationLevel authorizationLevel)`
  Creates a new result.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `NotificationPermissionResult.AuthorizationLevel`
  `getAuthorizationLevel()`
  Returns the granular authorization level.
  `boolean`
  `isGranted()`
  Returns true if notifications are permitted.
  `boolean`
  `isProvisional()`
  Returns true if the authorization is provisional (quiet) rather than explicit.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NotificationPermissionResult

    public NotificationPermissionResult(NotificationPermissionResult.AuthorizationLevel authorizationLevel)

    Creates a new result.

    ###### Parameters

    - `authorizationLevel`: the granular authorization level

- ## Method Details

  - ### isGranted

    public boolean isGranted()

    Returns true if notifications are permitted. This is true for any level more permissive than `AuthorizationLevel#DENIED` (authorized, provisional or ephemeral).

    ###### Returns

    true if notifications can be posted

  - ### getAuthorizationLevel

    public NotificationPermissionResult.AuthorizationLevel getAuthorizationLevel()

    Returns the granular authorization level.

    ###### Returns

    the authorization level

  - ### isProvisional

    public boolean isProvisional()

    Returns true if the authorization is provisional (quiet) rather than explicit.

    ###### Returns

    true if the authorization level is `AuthorizationLevel#PROVISIONAL`