subscriptionStorePolicyDestination(for:destination:)
Configures a view as the destination for a policy button action in subscription store views.
Declaration
nonisolated func subscriptionStorePolicyDestination(for button: SubscriptionStorePolicyKind, @ViewBuilder destination: () -> some View) -> some View
Parameters
- button:
The policy button to associate the URL with.
- destination:
The view to present when someone chooses to view the policy.
Discussion
Except on tvOS, you can also set a URL as the destination using subscriptionStorePolicyDestination(url:for:). If you do not set a destination, the system will use the automatic behavior. Check the documentation for the value you provide for button to understand the automatic behavior.
By default, the subscription store shows the terms of service & privacy policy buttons if you set a destination for at least one policy. The policy that is not explicitly set will use the automatic behavior. You can override this behavior using the storeButton(_:for:) modifier, with policies as the second parameter.
See Also
Interacting with the App Store and Apple Music
appStoreOverlay(isPresented:configuration:)manageSubscriptionsSheet(isPresented:)refundRequestSheet(for:isPresented:onDismiss:)offerCodeRedemption(isPresented:onCompletion:)musicSubscriptionOffer(isPresented:options:onLoadCompletion:)currentEntitlementTask(for:priority:action:)inAppPurchaseOptions(_:)manageSubscriptionsSheet(isPresented:subscriptionGroupID:)onInAppPurchaseCompletion(perform:)onInAppPurchaseStart(perform:)productIconBorder()productViewStyle(_:)productDescription(_:)storeButton(_:for:)storeProductTask(for:priority:action:)