From 5c5c741fba527b8ac5372cc2e50c6fa6938a8149 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Mon, 2 Sep 2024 21:23:08 +0200 Subject: [PATCH 1/8] fix release branch --- PadelClub/Utils/URLs.swift | 6 ++++++ PadelClub/Views/Tournament/Subscription/Guard.swift | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PadelClub/Utils/URLs.swift b/PadelClub/Utils/URLs.swift index f83495b..beb49a7 100644 --- a/PadelClub/Utils/URLs.swift +++ b/PadelClub/Utils/URLs.swift @@ -9,9 +9,15 @@ import Foundation enum URLs: String, Identifiable { +#if DEBUG case activationHost = "xlr.alwaysdata.net" case main = "https://xlr.alwaysdata.net/" case api = "https://xlr.alwaysdata.net/roads/" +#else + case activationHost = "padelclub.app" + case main = "https://padelclub.app/" + case api = "https://padelclub.app/roads/" +#endif case subscriptions = "https://apple.co/2Th4vqI" case beachPadel = "https://beach-padel.app.fft.fr/beachja/index/" diff --git a/PadelClub/Views/Tournament/Subscription/Guard.swift b/PadelClub/Views/Tournament/Subscription/Guard.swift index d0eec4e..2a6db5f 100644 --- a/PadelClub/Views/Tournament/Subscription/Guard.swift +++ b/PadelClub/Views/Tournament/Subscription/Guard.swift @@ -140,7 +140,14 @@ import LeStorage } var currentPlan: StoreItem? { - return .monthlyUnlimited + #if DEBUG + return .monthlyUnlimited + #else + if let currentBestPlan = self.currentBestPlan, let plan = StoreItem(rawValue: currentBestPlan.productID) { + return plan + } + return nil + #endif } func userFilteredPurchases() -> [StoreKit.Transaction] { From 7c3321b3b13532450bee09e7d4aff16a0fbc3d41 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Wed, 4 Sep 2024 08:13:18 +0200 Subject: [PATCH 2/8] b4 --- PadelClub.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index b938fc5..ae9b54f 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -1960,7 +1960,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -2010,7 +2010,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; From 486286db837f599005e729b612458955d570caf9 Mon Sep 17 00:00:00 2001 From: Raz Date: Fri, 6 Sep 2024 12:25:53 +0200 Subject: [PATCH 3/8] phrasing (cherry picked from commit a442cd934d7fba0a451f049179ce787b4b86cd0e) --- PadelClub/Views/Team/EditingTeamView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PadelClub/Views/Team/EditingTeamView.swift b/PadelClub/Views/Team/EditingTeamView.swift index 16eaad7..4bb148b 100644 --- a/PadelClub/Views/Team/EditingTeamView.swift +++ b/PadelClub/Views/Team/EditingTeamView.swift @@ -79,7 +79,7 @@ struct EditingTeamView: View { Toggle(isOn: confirmationReceived) { Text("Confirmation reçue") - Text("L'équipe vous a confirmé leur convocation") + Text("L'équipe vous a confirmé votre convocation") } } else { Text("Cette équipe n'a pas été convoquée") From 85f437dc086472ac0521ec59319057cc6eaca5e4 Mon Sep 17 00:00:00 2001 From: Raz Date: Fri, 6 Sep 2024 12:54:56 +0200 Subject: [PATCH 4/8] build 2 --- PadelClub.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 1ab3708..9fd3320 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -1960,7 +1960,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -2010,7 +2010,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; From c9b812cd7ea7d905465143ab226dff3d255ee4ae Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 9 Sep 2024 15:45:28 +0200 Subject: [PATCH 5/8] Change Guard init location --- PadelClub/AppDelegate.swift | 3 +++ PadelClub/Data/DataStore.swift | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PadelClub/AppDelegate.swift b/PadelClub/AppDelegate.swift index 14c46c1..e3d9e73 100644 --- a/PadelClub/AppDelegate.swift +++ b/PadelClub/AppDelegate.swift @@ -14,6 +14,9 @@ class AppDelegate : NSObject, UIApplicationDelegate, UNUserNotificationCenterDel func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + + _ = Guard.main // init guard + UIApplication.shared.registerForRemoteNotifications() UNUserNotificationCenter.current().delegate = self diff --git a/PadelClub/Data/DataStore.swift b/PadelClub/Data/DataStore.swift index 2a05d74..d9d04ac 100644 --- a/PadelClub/Data/DataStore.swift +++ b/PadelClub/Data/DataStore.swift @@ -67,9 +67,7 @@ class DataStore: ObservableObject { StoreCenter.main.logsFailedAPICalls() var synchronized: Bool = true - - _ = Guard.main // init - + #if DEBUG if let sync = PListReader.readBool(plist: "local", key: "synchronized") { synchronized = sync From 7d4ccf0f67f767d3955de45fd979fd0dfaaec7b7 Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 9 Sep 2024 17:16:23 +0200 Subject: [PATCH 6/8] adds a way to see product ids in the interface --- .../xcshareddata/xcschemes/PadelClub.xcscheme | 2 +- .../Views/Navigation/Umpire/UmpireView.swift | 40 ++++++++++++++++++- .../Views/Tournament/Subscription/Guard.swift | 24 +++++++++-- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub.xcscheme b/PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub.xcscheme index b4b5279..d92da1f 100644 --- a/PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub.xcscheme +++ b/PadelClub.xcodeproj/xcshareddata/xcschemes/PadelClub.xcscheme @@ -74,7 +74,7 @@ + identifier = "../PadelClub/SyncedProducts.storekit"> ? = nil + var updateListenerTask: Task? = nil fileprivate(set) var purchases: StoredCollection @@ -39,6 +39,23 @@ import LeStorage } } + deinit { + self.updateListenerTask?.cancel() + } + + func productIds() async -> [String] { + var productIds: [String] = [] + for await result in Transaction.all { + do { + let verified = try self.checkVerified(result) + productIds.append(verified.productID) + } catch { + Logger.error(error) + } + } + return productIds + } + func refreshPurchasedAppleProducts() async throws { // Iterate through the user's purchased products. @@ -51,10 +68,11 @@ import LeStorage } } - func listenForTransactions() -> Task { - return Task.detached { + func listenForTransactions() -> Task { + return Task(priority: .background) { //Iterate through any transactions which didn't come from a direct call to `purchase()`. for await result in Transaction.updates { + Logger.log(">>> update = \(result)") do { let transaction = try self.checkVerified(result) From 63f5b509d2a128a076bb7747145d0cb30f14700b Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Tue, 3 Sep 2024 11:11:13 +0200 Subject: [PATCH 7/8] b3 --- PadelClub.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 9fd3320..9877cfd 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -1960,7 +1960,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -2010,7 +2010,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; From 6b354884d86e4fa766a1d3c8a1058c61262b1127 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Mon, 9 Sep 2024 19:07:57 +0200 Subject: [PATCH 8/8] 1.0.7 --- PadelClub.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 9877cfd..38bcf36 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -1960,7 +1960,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -1985,7 +1985,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; OTHER_SWIFT_FLAGS = "-Onone"; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; @@ -2010,7 +2010,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; @@ -2033,7 +2033,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-function-bodies=5 -Xfrontend -warn-long-expression-type-checking=20 -Xfrontend -warn-long-function-bodies=50"; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;