Class NotificationPermissionResult
The result of a notification permission request delivered to a
NotificationPermissionCallback. It exposes whether the user granted permission
and the granular authorization level that was returned by the platform.
The authorization levels mirror the iOS UNAuthorizationStatus values. On platforms
that only have a binary granted/denied model (such as Android) the level will be
either #AUTH_AUTHORIZED or #AUTH_DENIED.
See also
-
NotificationPermissionCallback
-
NotificationPermissionRequest
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe user granted full notification permission.static final intThe user explicitly denied notification permission.static final intNotifications were authorized for a limited amount of time (App Clip style).static final intThe user has not yet made a choice regarding notification permission.static final intNotifications were authorized provisionally (delivered quietly without an explicit prompt). -
Constructor Summary
ConstructorsConstructorDescriptionNotificationPermissionResult(boolean granted, int authorizationLevel) Creates a new result. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the granular authorization level, one of theAUTH_constants.booleanReturns true if notifications are permitted, including provisional authorization.booleanReturns true if the authorization is provisional (quiet) rather than explicit.
-
Field Details
-
AUTH_NOT_DETERMINED
public static final int AUTH_NOT_DETERMINEDThe user has not yet made a choice regarding notification permission.- See Also:
-
AUTH_DENIED
public static final int AUTH_DENIEDThe user explicitly denied notification permission.- See Also:
-
AUTH_AUTHORIZED
public static final int AUTH_AUTHORIZEDThe user granted full notification permission.- See Also:
-
AUTH_PROVISIONAL
public static final int AUTH_PROVISIONALNotifications were authorized provisionally (delivered quietly without an explicit prompt). Applies to iOS provisional authorization.- See Also:
-
AUTH_EPHEMERAL
public static final int AUTH_EPHEMERALNotifications were authorized for a limited amount of time (App Clip style).- See Also:
-
-
Constructor Details
-
NotificationPermissionResult
public NotificationPermissionResult(boolean granted, int authorizationLevel) Creates a new result.
Parameters
-
granted: true if notifications are allowed (full or provisional) -
authorizationLevel: one of theAUTH_constants
-
-
-
Method Details
-
isGranted
public boolean isGranted()Returns true if notifications are permitted, including provisional authorization.
Returns
true if notifications can be posted
-
getAuthorizationLevel
public int getAuthorizationLevel()Returns the granular authorization level, one of the
AUTH_constants.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
#AUTH_PROVISIONAL
-