WIP
This commit is contained in:
@@ -23,6 +23,8 @@ class IAPManager: ObservableObject {
|
||||
@Published private(set) var subscriptions = [Product: (status: [Product.SubscriptionInfo.Status], renewalInfo: RenewalInfo)?]()
|
||||
@AppStorage(UserDefaultsStore.Keys.firstLaunchDate.rawValue, store: GroupUserDefaults.groupDefaults) private var firstLaunchDate = Date()
|
||||
|
||||
@Published private(set) var isLoadingSubscriptions = false
|
||||
|
||||
public var sortedSubscriptionKeysByPriceOptions: [Product] {
|
||||
subscriptions.keys.sorted(by: {
|
||||
$0.price < $1.price
|
||||
@@ -89,7 +91,7 @@ class IAPManager: ObservableObject {
|
||||
}
|
||||
|
||||
private let iapIdentifiers = Set([
|
||||
"com.88oakapps.ifeel.IAP.subscriptions.weekly",
|
||||
// "com.88oakapps.ifeel.IAP.subscriptions.weekly",
|
||||
"com.88oakapps.ifeel.IAP.subscriptions.monthly",
|
||||
"com.88oakapps.ifeel.IAP.subscriptions.yearly"
|
||||
])
|
||||
@@ -97,6 +99,8 @@ class IAPManager: ObservableObject {
|
||||
var expireOnTimer: Timer?
|
||||
|
||||
init() {
|
||||
isLoadingSubscriptions = true
|
||||
|
||||
//Start a transaction listener as close to app launch as possible so you don't miss any transactions.
|
||||
updateListenerTask = listenForTransactions()
|
||||
|
||||
@@ -133,6 +137,9 @@ class IAPManager: ObservableObject {
|
||||
|
||||
decideShowIAP()
|
||||
decideShowIAPWarning()
|
||||
DispatchQueue.main.async {
|
||||
self.isLoadingSubscriptions = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user