SubscriptionStoreView is a complete subscription paywall in one line: it loads a subscription
group, renders the plans, and runs purchase, upgrade, downgrade, and crossgrade flows.
Showing a Group
Pass the subscription group identifier, not its title. To narrow the list, pass product ids
instead, but they must belong to one group. A third initializer takes loaded Product values.
SubscriptionStoreView(groupID: "598392E1")
SubscriptionStoreView(productIDs: ["123456789", "987654321"])
visibleRelationships filters which plans appear relative to the user's current subscription:
.all, .upgrade, .downgrade, .crossgrade, or .current to show only the active plan. The
storeButton modifier controls the built-in buttons, as on StoreView.
Marketing Content and Background
The default header is the app icon plus the group title. Replace it with your own view, the usual place for a feature list.
SubscriptionStoreView(groupID: "598392E1", visibleRelationships: .all) {
MyMarketingContentView()
.containerBackground(Color.blue, for: .subscriptionStoreHeader)
.containerBackground(Color.red, for: .subscriptionStoreFullHeight)
}
containerBackground places a SwiftUI view behind the store; the placement argument chooses the
header area or the full height.
Controls and Button Labels
subscriptionStoreControlStyle picks how plans are chosen: buttons, picker,
prominentPicker, or automatic. Not every style exists on every platform, which is why
automatic is the default.
SubscriptionStoreView(groupID: "598392E1")
.subscriptionStoreControlStyle(.buttons)
.subscriptionStoreButtonLabel(.multiline)
subscriptionStoreButtonLabel shapes the call-to-action text. The automatic label already
adapts, "Try free" with a trial, "Change to" with an active plan; .multiline fits more plan
detail into the button. With the buttons control style, the label applies to every plan button.