diff --git a/Reflect/Localizable.xcstrings b/Reflect/Localizable.xcstrings index 7a8e6f5..c229dab 100644 --- a/Reflect/Localizable.xcstrings +++ b/Reflect/Localizable.xcstrings @@ -3848,6 +3848,10 @@ } } }, + "Close" : { + "comment" : "An accessibility label for the button that dismisses the view.", + "isCommentAutoGenerated" : true + }, "content_view_delete_entry" : { "extractionState" : "manual", "localizations" : { diff --git a/Shared/IAPManager.swift b/Shared/IAPManager.swift index d648a9e..4f5825c 100644 --- a/Shared/IAPManager.swift +++ b/Shared/IAPManager.swift @@ -49,7 +49,7 @@ class IAPManager: ObservableObject { static let subscriptionGroupID = "21951685" - private let productIdentifiers: Set = [ + static let productIdentifiers: Set = [ "com.88oakapps.reflect.IAP.subscriptions.monthly", "com.88oakapps.reflect.IAP.subscriptions.yearly" ] @@ -267,7 +267,7 @@ class IAPManager: ObservableObject { private func loadProducts() async { do { - let products = try await Product.products(for: productIdentifiers) + let products = try await Product.products(for: Self.productIdentifiers) availableProducts = products.filter { $0.type == .autoRenewable } } catch { AppLogger.iap.error("Failed to load products: \(error.localizedDescription)") @@ -284,7 +284,7 @@ class IAPManager: ObservableObject { if transaction.revocationDate != nil { continue } // Check if this is one of our subscription products - guard productIdentifiers.contains(transaction.productID) else { continue } + guard Self.productIdentifiers.contains(transaction.productID) else { continue } // Get the product for this transaction currentProduct = availableProducts.first { $0.id == transaction.productID } diff --git a/Shared/Views/ReflectSubscriptionStoreView.swift b/Shared/Views/ReflectSubscriptionStoreView.swift index 1f03b20..b973161 100644 --- a/Shared/Views/ReflectSubscriptionStoreView.swift +++ b/Shared/Views/ReflectSubscriptionStoreView.swift @@ -27,13 +27,25 @@ struct ReflectSubscriptionStoreView: View { } var body: some View { - SubscriptionStoreView(groupID: IAPManager.subscriptionGroupID) { + SubscriptionStoreView(productIDs: IAPManager.productIdentifiers) { marketingContent } .subscriptionStoreControlStyle(.prominentPicker) .storeButton(.visible, for: .restorePurchases) .subscriptionStoreButtonLabel(.multiline) .tint(tintColor) + .overlay(alignment: .topTrailing) { + Button { + dismiss() + } label: { + Image(systemName: "xmark.circle.fill") + .font(.title2) + .symbolRenderingMode(.hierarchical) + .foregroundStyle(.secondary) + } + .padding(16) + .accessibilityLabel("Close") + } .onAppear { AnalyticsManager.shared.trackPaywallViewed(source: source) }