Merge pull request #6 from akatreyt/fix/issue-3

This commit is contained in:
akatreyt
2026-02-21 18:06:04 -06:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ struct PaywallView: View {
} }
} }
.storeButton(.visible, for: .restorePurchases) .storeButton(.visible, for: .restorePurchases)
.storeButton(.visible, for: .redeemCode)
.subscriptionStoreControlStyle(.prominentPicker) .subscriptionStoreControlStyle(.prominentPicker)
.subscriptionStoreButtonLabel(.displayName.multiline) .subscriptionStoreButtonLabel(.displayName.multiline)
.onInAppPurchaseStart { product in .onInAppPurchaseStart { product in

View File

@@ -3,6 +3,7 @@
// SportsTime // SportsTime
// //
import StoreKit
import SwiftUI import SwiftUI
struct SettingsView: View { struct SettingsView: View {
@@ -11,6 +12,7 @@ struct SettingsView: View {
@State private var viewModel = SettingsViewModel() @State private var viewModel = SettingsViewModel()
@State private var showResetConfirmation = false @State private var showResetConfirmation = false
@State private var showPaywall = false @State private var showPaywall = false
@State private var showRedeemCode = false
@State private var showOnboardingPaywall = false @State private var showOnboardingPaywall = false
@State private var showSyncLogs = false @State private var showSyncLogs = false
@State private var isSyncActionInProgress = false @State private var isSyncActionInProgress = false
@@ -79,6 +81,7 @@ struct SettingsView: View {
.sheet(isPresented: $showPaywall) { .sheet(isPresented: $showPaywall) {
PaywallView(source: "settings") PaywallView(source: "settings")
} }
.offerCodeRedemption(isPresented: $showRedeemCode)
.sheet(isPresented: $showOnboardingPaywall) { .sheet(isPresented: $showOnboardingPaywall) {
OnboardingPaywallView(isPresented: $showOnboardingPaywall) OnboardingPaywallView(isPresented: $showOnboardingPaywall)
} }
@@ -812,6 +815,13 @@ struct SettingsView: View {
Label("Restore Purchases", systemImage: "arrow.clockwise") Label("Restore Purchases", systemImage: "arrow.clockwise")
} }
.accessibilityIdentifier("settings.restorePurchasesButton") .accessibilityIdentifier("settings.restorePurchasesButton")
Button {
showRedeemCode = true
} label: {
Label("Redeem Code", systemImage: "giftcard")
}
.accessibilityIdentifier("settings.redeemCodeButton")
} }
} header: { } header: {
Text("Subscription") Text("Subscription")