| 123456789101112131415161718192021222324 |
- import Foundation
- enum SubscriptionProductID {
- static let monthly = "com.app_for_reddit.pro.monthly"
- static let yearly = "com.app_for_reddit.pro.yearly"
- static let lifetime = "com.app_for_reddit.pro.lifetime"
- static let catalog: [String] = [monthly, yearly, lifetime]
- static func productIDs(from config: PaywallConfig) -> [String] {
- if let ids = config.productIDs, !ids.isEmpty {
- return ids
- }
- return catalog
- }
- static func planKey(for productID: String) -> String {
- productID.split(separator: ".").last.map(String.init) ?? productID
- }
- static func plan(for productID: String) -> PaywallPlan? {
- PaywallPlan(productID: productID)
- }
- }
|