Class NotificationPermissionResult

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

public class NotificationPermissionResult extends 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

  • Constructor Details

  • 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