Release 1.0.0 baseline
This commit is contained in:
@@ -28,10 +28,6 @@ final class StoreManager: ObservableObject {
|
||||
@Published var debugLoadedProducts: [String] = []
|
||||
|
||||
static let monthlyProductId = "com.mealmood.premium.monthly"
|
||||
static let monthlyProductIdAlt = "com.alexandrevazquez.mealmood.premium.monthly"
|
||||
static let monthlyProductIdLegacy = "com.alexandrev.mealmood.premium.monthly"
|
||||
static let monthlyProductIdShort = "com.alexandrevazquez.mealmood.premium"
|
||||
|
||||
private var productIds: [String] {
|
||||
var ids = [Self.monthlyProductId]
|
||||
|
||||
@@ -114,20 +110,13 @@ final class StoreManager: ObservableObject {
|
||||
}
|
||||
|
||||
var monthlyProduct: Product? {
|
||||
let prioritizedIds = [
|
||||
Self.monthlyProductIdAlt,
|
||||
Self.monthlyProductId,
|
||||
Self.monthlyProductIdLegacy,
|
||||
Self.monthlyProductIdShort
|
||||
]
|
||||
|
||||
if let match = products.first(where: { product in
|
||||
prioritizedIds.contains(product.id) && product.type == .autoRenewable
|
||||
product.id == Self.monthlyProductId && product.type == .autoRenewable
|
||||
}) {
|
||||
return match
|
||||
}
|
||||
|
||||
if let match = products.first(where: { prioritizedIds.contains($0.id) }) {
|
||||
if let match = products.first(where: { $0.id == Self.monthlyProductId }) {
|
||||
return match
|
||||
}
|
||||
|
||||
@@ -145,10 +134,7 @@ final class StoreManager: ObservableObject {
|
||||
var debugProductIds: [String] { productIds }
|
||||
|
||||
static func hasActiveSubscription(productIds: [String] = [
|
||||
StoreManager.monthlyProductId,
|
||||
StoreManager.monthlyProductIdAlt,
|
||||
StoreManager.monthlyProductIdLegacy,
|
||||
StoreManager.monthlyProductIdShort
|
||||
StoreManager.monthlyProductId
|
||||
]) async -> Bool {
|
||||
for await result in Transaction.currentEntitlements {
|
||||
if case .verified(let transaction) = result,
|
||||
|
||||
Reference in New Issue
Block a user