Contents

subscriptionStorePolicyDestination(url:for:)

Configures a URL as the destination for a policy button action in subscription store views.

Declaration

nonisolated func subscriptionStorePolicyDestination(url: URL, for button: SubscriptionStorePolicyKind) -> some View

Parameters

  • url:

    The URL of the web page to open when someone chooses to view the policy.

  • button:

    The policy button to associate the URL with.

Discussion

You can also set a view as the destination using subscriptionStorePolicyDestination(for:destination:). If you do not set a destination, or pass nil for url, 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