From b123b249278d4d6d2df71c40ef3dbb8b2b95812e Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 4 Apr 2025 19:10:28 +0200 Subject: [PATCH] in debug use local.plist setting for plan --- .../Views/Tournament/Subscription/Guard.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/PadelClub/Views/Tournament/Subscription/Guard.swift b/PadelClub/Views/Tournament/Subscription/Guard.swift index 570ccc7..77106fa 100644 --- a/PadelClub/Views/Tournament/Subscription/Guard.swift +++ b/PadelClub/Views/Tournament/Subscription/Guard.swift @@ -187,18 +187,20 @@ import LeStorage } var currentPlan: StoreItem? { -// #if DEBUG -// return .monthlyUnlimited -// #elseif TESTFLIGHT -// return .monthlyUnlimited -// #elseif PRODTEST -// return .monthlyUnlimited -// #else + #if DEBUG + if let plan = PListReader.readString(plist: "local", key: "plan"), !plan.isEmpty { + return StoreItem(rawValue: plan) + } + #elseif TESTFLIGHT + return .monthlyUnlimited + #elseif PRODTEST + return .monthlyUnlimited + #else if let currentBestPurchase = self.currentBestPurchase, let plan = StoreItem(rawValue: currentBestPurchase.productId) { return plan } + #endif return nil -// #endif } func userFilteredPurchases() -> [StoreKit.Transaction] {