Back to Swift Reference Ask BeeAI
💳 StoreKit 2AdvancediOS 17+ (SubscriptionStoreView)
Subscriptions & Entitlements
Show a native paywall and decide who has Pro access using current entitlements.
SubscriptionStoreView renders a compliant, localized paywall for a subscription group in a few lines.
Transaction.currentEntitlements is the source of truth for what the user owns right now — check it at launch and after every purchase.
subscription-status.swift
1import StoreKit
2import SwiftUI
3
4struct PaywallView: View {
5 var body: some View {
6 SubscriptionStoreView(groupID: "21456789") {
7 VStack {
8 Text("Go Pro").font(.largeTitle.bold())
9 Text("Unlimited AI summaries and sync.")
10 }
11 }
12 .subscriptionStoreControlStyle(.prominentPicker)
13 }
14}
15
16func hasProAccess() async -> Bool {
17 for await result in Transaction.currentEntitlements {
18 if case .verified(let transaction) = result,
19 transaction.productType == .autoRenewable,
20 transaction.revocationDate == nil {
21 return true
22 }
23 }
24 return false
25}Common pitfalls
- Offer a visible “Restore Purchases” path (AppStore.sync()) — App Review checks for it.
Still unclear? Ask BeeAI about Subscriptions & Entitlements.
Get a tailored explanation, or paste your own code for a Swift 6 review. Free members get daily questions — Pro is unlimited.
Related topics
Become a Founding Pro member: unlimited BeeAI, upcoming Swift paths and every new reference entry first.
See Pro Plans