AirshipPermissionsManager
public protocol AirshipPermissionsManager : Sendable
Airship permissions manager.
Airship will provide the default handling for Permission.postNotifications. All other permissions will need
to be configured by the app by providing a PermissionDelegate for the given permissions.
-
The set of permissions that have a configured delegate.
Declaration
Swift
var configuredPermissions: Set<AirshipPermission> { get } -
Returns an async stream with status updates for the given permission
Declaration
Swift
func statusUpdate( for permission: AirshipPermission ) -> AsyncStream<AirshipPermissionStatus>Parameters
permissionThe permission.
-
Sets a permission delegate.
Note
The delegate will be strongly retained.
Declaration
Swift
func setDelegate( _ delegate: (any AirshipPermissionDelegate)?, permission: AirshipPermission )Parameters
delegateThe delegate.
permissionThe permission.
-
checkPermissionStatus(_:Asynchronous) Checks a permission status.
Note
If no delegate is set for the given permission this will always return
.notDetermined.Declaration
Swift
@MainActor func checkPermissionStatus( _ permission: AirshipPermission ) async -> AirshipPermissionStatusParameters
permissionThe permission.
-
requestPermission(_:Asynchronous) Requests a permission.
Note
If no permission delegate is set for the given permission this will always return
.notDeterminedDeclaration
Swift
@MainActor func requestPermission( _ permission: AirshipPermission ) async -> AirshipPermissionStatusParameters
permissionThe permission.
-
requestPermission(_:AsynchronousenableAirshipUsageOnGrant: ) Requests a permission.
Note
If no permission delegate is set for the given permission this will always return
.notDeterminedDeclaration
Swift
@MainActor func requestPermission( _ permission: AirshipPermission, enableAirshipUsageOnGrant: Bool ) async -> AirshipPermissionStatusParameters
permissionThe permission.
enableAirshipUsageOnGranttrueto allow any Airship features that need the permission to be enabled as well, e.g., enabling push privacy manager feature and user notifications if.displayNotificationsis granted. -
Requests a permission.
Declaration
Swift
@MainActor func requestPermission( _ permission: AirshipPermission, enableAirshipUsageOnGrant: Bool, fallback: PromptPermissionFallback ) async -> AirshipPermissionResultParameters
permissionThe permission.
enableAirshipUsageOnGranttrueto allow any Airship features that need the permission to be enabled as well, e.g., enabling push privacy manager feature and user notifications if.displayNotificationsis granted.fallbackThe fallback behavior if the permission is alreay denied.
Return Value
A
AirshipPermissionResultwith the starting and ending status If no permission delegate is set for the given permission the status will be.notDetermined
View on GitHub