struct StructureScopedPermissionsControllerextension StructureScopedPermissionsController : SendableA controller for managing structure scoped permissions.
-
A feature that can be consented to via the permissions controller.
Declaration
Swift
enum Featureextension StructureScopedPermissionsController.Feature : CaseIterable, Equatable, Hashable, Sendable -
The status of the consent.
Declaration
Swift
enum ConsentStatusextension StructureScopedPermissionsController.ConsentStatus : Equatable, Hashable, Sendable -
The response from the consent request.
Declaration
Swift
enum ConsentResponseextension StructureScopedPermissionsController.ConsentResponse : Sendable -
Returns a set of all features for which the user has granted consent.
Declaration
Swift
func consentedFeatures() async -> Set<StructureScopedPermissionsController.Feature> -
The consent status for the given features.
Declaration
Swift
func featureConsentState(features: [StructureScopedPermissionsController.Feature]) async -> [StructureScopedPermissionsController.Feature : StructureScopedPermissionsController.ConsentStatus]Parameters
featuresThe features to retrieve the consent status for.
Return Value
A map of feature to consent status.
-
Returns the device type permissions that have been granted to this app for the current structure.
Note: Permissions are managed on a per-device-type basis. For sensitive devices, granting permission to a single device results in permission being granted for all devices of that same type within the structure.
Declaration
Swift
func deviceTypeGrants() async -> DeviceTypeGrants -
Presents a view for users to consent to the given features.
Declaration
Swift
func requestConsent(for features: [StructureScopedPermissionsController.Feature]) async -> StructureScopedPermissionsController.ConsentResponse?Return Value
The response from the consent request. Returns nil if the user has already consented to the features or an error occurred.
-
Undocumented
Declaration
Swift
struct UserMetadataextension StructureScopedPermissionsController.UserMetadata : Equatable, Sendable -
Fetches the metadata for the currently signed-in user within the context of this structure.
This includes information such as the user’s ID, email, profile picture URL, and name.
Declaration
Swift
func currentUserMetadata() async throws -> StructureScopedPermissionsController.UserMetadata -
Returns an
AsyncThrowingStreamindicating whether the user has opted in to user presence for the current structure.The stream yields
trueif the user has opted in to user presence, andfalseotherwise.Declaration
Swift
@available(*, deprecated, message: "This API is experimental and is subject to change in a future SDK release.") func presenceOptInStatus() async -> AsyncThrowingStream<Bool, any Error> -
Sets the user’s opt-in status for user presence for the current structure.
This will update the
UserPresenceSettingsTraitof theApplicationInfoobject which is managed on a per-application, per-structure, per-user basis.Throws
AHomeErrorerror if the opt-in status could not be updated.Declaration
Swift
@available(*, deprecated, message: "This API is experimental and is subject to change in a future SDK release.") func setPresenceOptIn(_ optIn: Bool) async throwsParameters
optIntrueto opt the user in,falseto opt the user out.