Files
IYmtg/IYmtg_App_iOS/AppConfig.swift
2026-02-24 09:12:46 -05:00

62 lines
1.9 KiB
Swift

import Foundation
enum CurrencyCode: String, CaseIterable, Codable {
case usd = "USD"
case eur = "EUR"
var symbol: String {
switch self {
case .usd: return "$"
case .eur: return ""
}
}
var scryfallKey: String {
switch self {
case .usd: return "usd"
case .eur: return "eur"
}
}
}
struct AppConfig {
// 1. CONTACT EMAIL (Required by Scryfall)
static let contactEmail = "support@iymtg.com" // Example: Use your real email
// 2. IN-APP PURCHASE ID (Use a "Consumable" type in App Store Connect for repeatable tips)
static let tipJarProductIDs: [String] = [] // Example: Use your real Product ID
// Feature Flags
static let enableFoilDetection = true
static let enableConditionGrading = true
static let enableSetSymbolDetection = true
static let enableStampDetection = true
static let defaultCurrency: CurrencyCode = .usd
struct Defaults {
static let masterCollectionName = "Master Collection"
static let unsortedBoxName = "Unsorted"
static let defaultCondition = "Near Mint (NM)"
static let defaultFoil = "None"
}
static var isTrainingOptIn: Bool {
get { UserDefaults.standard.bool(forKey: "TrainingOptIn") }
set { UserDefaults.standard.set(newValue, forKey: "TrainingOptIn") }
}
static var scryfallUserAgent: String {
return "IYmtg/1.0 (\(contactEmail))"
}
static func validate() {
#if DEBUG
if contactEmail.contains("yourdomain.com") {
fatalError("🛑 SETUP ERROR: Change 'contactEmail' in AppConfig.swift to your real email.")
}
if let first = tipJarProductIDs.first, (first.contains("yourname") || first == "com.iymtg.app.tip") {
print("⚠️ CONFIG WARNING: 'tipJarProductIDs' contains placeholder. IAP will not load.")
}
#endif
}
}