Contents

Product.SubscriptionInfo.MultiSeatDataSharingConsentEligibility

Values that indicate whether you can request consent to share group information for a subscription group.

Declaration

enum MultiSeatDataSharingConsentEligibility

Overview

Group information is the membership of a multiseat subscription’s group. Data sharing consent applies only to subscriptions that use Apple-hosted invitations. Only the group purchaser can choose whether to share group information with you, and they can change the choice at any time in Manage Subscriptions. While they share it, the group appears in the responses from Get Customer Groups and Get Group Members in the App Store Server API.

Check the eligibility each time before you present the data sharing consent sheet, so you ask only the group purchaser. If you haven’t checked it since the sheet was last presented, presenting the sheet throws StoreKitError.unsupported. If the value is Product.SubscriptionInfo.MultiSeatDataSharingConsentEligibility.ineligible(_:), its associated value tells you the reason. StoreKit might add eligibility values in the future, so include an @unknown default case when you switch over the eligibility.

The following example checks the eligibility before it presents the sheet in UIKit:

func requestGroupInformationConsent(
    for subscription: Product.SubscriptionInfo,
    from viewController: UIViewController
) async throws {
    guard try await subscription.multiSeatDataSharingConsentEligibility == .eligible else {
        return
    }
    try await AppStore.presentMultiSeatDataSharingConsentSheet(
        from: viewController,
        subscriptionGroupID: subscription.subscriptionGroupID
    )
}

In AppKit, call presentMultiSeatDataSharingConsentSheet(from:subscriptionGroupID:). In SwiftUI, use the multiSeatDataSharingConsentSheet(isPresented:subscriptionGroupID:onCompletion:) view modifier. For more information, see Show the group in your app.

Topics

Identifying the eligibility

Getting the reason

See Also

Checking data sharing consent eligibility