Make full version check for old builds nicer

This commit is contained in:
Davide De Rosa 2021-02-05 18:47:32 +01:00
parent 9d92453110
commit d76a248bd0
2 changed files with 6 additions and 6 deletions

View File

@ -357,11 +357,11 @@ public class AppConstants {
return ProcessInfo.processInfo.environment["FULL_VERSION"] != nil
}
static let lastFullVersionBuild = 2016
static let lastFullVersionBuild: (Int, Product) = (2016, .fullVersion_iOS)
#else
static let isBetaFullVersion = false
static let lastFullVersionBuild = 0
static let lastFullVersionBuild: (Int, Product) = (0, .fullVersion_macOS)
#endif
}
}

View File

@ -44,12 +44,12 @@ public class ProductManager: NSObject {
public let isBetaFullVersion: Bool
public let lastFullVersionBuild: Int
public let lastFullVersionBuild: (Int, Product)
public init(
locksBetaFeatures: Bool,
isBetaFullVersion: Bool,
lastFullVersionBuild: Int
lastFullVersionBuild: (Int, Product)
) {
self.locksBetaFeatures = locksBetaFeatures
self.isBetaFullVersion = isBetaFullVersion
@ -258,8 +258,8 @@ public class ProductManager: NSObject {
log.debug("Original purchased build: \(buildNumber)")
// treat former purchases as full versions
if buildNumber <= cfg.lastFullVersionBuild {
purchasedFeatures.insert(.fullVersion_iOS)
if buildNumber <= cfg.lastFullVersionBuild.0 {
purchasedFeatures.insert(cfg.lastFullVersionBuild.1)
}
}
if let iapReceipts = receipt.inAppPurchaseReceipts {