Skip to content

v2.4.0

Choose a tag to compare

@github-actions github-actions released this 25 Mar 14:13
· 8 commits to main since this release

StoreContext exposes a tri-state purchase status. At app launch, purchaseStatus starts as .loading until Transaction.currentEntitlements finishes its first sync. During this stage, hasPurchased and hasNotPurchased both return false, so startup code will not accidentally treat the user as "not purchased".

switch store.purchaseStatus {
case .loading:
    // Purchase state is still being resolved
case .purchased:
    // ✅ User has active purchases
case .notPurchased:
    // 🧾 User has no active purchases
}

Recommended usage:

@EnvironmentObject var store: StoreContext

var body: some View {
    switch store.purchaseStatus {
    case .loading:
        ProgressView("Checking purchases...")
    case .purchased:
        // ✅ User has purchased - show full functionality
    case .notPurchased:
        // 🧾 User hasn't purchased - show limited content or purchase prompt
    }
}

Compatible legacy usage:

@EnvironmentObject var store: StoreContext

var body: some View {
    if store.hasResolvedPurchaseStatus == false {
        ProgressView("Checking purchases...")
    } else if store.hasNotPurchased == true {
        // 🧾 User hasn't purchased - show limited content or purchase prompt
    } else if store.hasPurchased == true {
        // ✅ User has purchased - show full functionality
    }
}