SubscriptionStoreButton
A button for subscribing to an in-app subscription with a localized label and optional caption.
Declaration
@MainActor @preconcurrency struct SubscriptionStoreButtonOverview
When implementing custom subscription store control styles conforming to SubscriptionStoreControlStyle, you can use this button to utilize the standard subscribe button as a component of the view you provide from makeBody(configuration:). The subscription store button automatically generates a localized label and optional caption for the corresponding subscription option. To configure a custom button label, use Button instead.
Standard subscription store control styles use the subscription store button. For example, the buttons style creates a SubscriptionStoreButton instance for each subscription option.
In iOS, macOS, visionOS and watchOS you can configure the button’s label by modifying it with subscriptionStoreButtonLabel(_:). Some button label configurations cause the button to have a caption, for example .displayName.singleLine.
Because the SubscriptionStoreButton is composed of a SwiftUI Button, you can also configure the button using other built-in view modifiers such as buttonStyle(_:).
To create a SubscriptionStoreButton, provide a value of SubscriptionStoreControlStyleConfiguration.Option to the init(_:) method. Get an option value from the required makeBody(configuration:) method on your SubscriptionStoreControlStyle implementation.