Class NotificationPermissionResult
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 ClassesModifier and TypeClassDescriptionstatic enumThe granular authorization level returned by the platform. -
Constructor Summary
ConstructorsConstructorDescriptionNotificationPermissionResult(NotificationPermissionResult.AuthorizationLevel authorizationLevel) Creates a new result. -
Method Summary
Modifier and TypeMethodDescriptionReturns the granular authorization level.booleanReturns true if notifications are permitted.booleanReturns true if the authorization is provisional (quiet) rather than explicit.
-
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
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
-