From 1ccf6ffadc7f5015a1ad148e88b87b52c03c5feb Mon Sep 17 00:00:00 2001 From: hengyu Date: Sat, 4 May 2024 10:17:47 +0800 Subject: [PATCH] Update `subscriptionHelper` declaration --- Sources/StoreHelper/Core/StoreHelper.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Sources/StoreHelper/Core/StoreHelper.swift b/Sources/StoreHelper/Core/StoreHelper.swift index 0b70310f8..f6bfe9402 100644 --- a/Sources/StoreHelper/Core/StoreHelper.swift +++ b/Sources/StoreHelper/Core/StoreHelper.swift @@ -89,8 +89,8 @@ public class StoreHelper: ObservableObject { public private(set) var isAppStoreAvailable = false /// Subscription-related helper methods. - public var subscriptionHelper: SubscriptionHelper! - + public private(set) lazy var subscriptionHelper: SubscriptionHelper = .init(storeHelper: self) + /// True if StoreHelper has been initialized correctly by calling start(). public var hasStarted: Bool { transactionListener != nil && isAppStoreAvailable } @@ -212,9 +212,6 @@ public class StoreHelper: ObservableObject { // Add a helper for StoreKit1-based direct purchases from the app store (IAP promotions) appStoreHelper = AppStoreHelper(storeHelper: self) - // Initialize our subscription helper - subscriptionHelper = SubscriptionHelper(storeHelper: self) - // Read our list of product ids productIds = storeConfiguration.readConfigFile()