Make full version check for old builds nicer
This commit is contained in:
parent
9d92453110
commit
d76a248bd0
|
@ -357,11 +357,11 @@ public class AppConstants {
|
||||||
return ProcessInfo.processInfo.environment["FULL_VERSION"] != nil
|
return ProcessInfo.processInfo.environment["FULL_VERSION"] != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
static let lastFullVersionBuild = 2016
|
static let lastFullVersionBuild: (Int, Product) = (2016, .fullVersion_iOS)
|
||||||
#else
|
#else
|
||||||
static let isBetaFullVersion = false
|
static let isBetaFullVersion = false
|
||||||
|
|
||||||
static let lastFullVersionBuild = 0
|
static let lastFullVersionBuild: (Int, Product) = (0, .fullVersion_macOS)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,12 +44,12 @@ public class ProductManager: NSObject {
|
||||||
|
|
||||||
public let isBetaFullVersion: Bool
|
public let isBetaFullVersion: Bool
|
||||||
|
|
||||||
public let lastFullVersionBuild: Int
|
public let lastFullVersionBuild: (Int, Product)
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
locksBetaFeatures: Bool,
|
locksBetaFeatures: Bool,
|
||||||
isBetaFullVersion: Bool,
|
isBetaFullVersion: Bool,
|
||||||
lastFullVersionBuild: Int
|
lastFullVersionBuild: (Int, Product)
|
||||||
) {
|
) {
|
||||||
self.locksBetaFeatures = locksBetaFeatures
|
self.locksBetaFeatures = locksBetaFeatures
|
||||||
self.isBetaFullVersion = isBetaFullVersion
|
self.isBetaFullVersion = isBetaFullVersion
|
||||||
|
@ -258,8 +258,8 @@ public class ProductManager: NSObject {
|
||||||
log.debug("Original purchased build: \(buildNumber)")
|
log.debug("Original purchased build: \(buildNumber)")
|
||||||
|
|
||||||
// treat former purchases as full versions
|
// treat former purchases as full versions
|
||||||
if buildNumber <= cfg.lastFullVersionBuild {
|
if buildNumber <= cfg.lastFullVersionBuild.0 {
|
||||||
purchasedFeatures.insert(.fullVersion_iOS)
|
purchasedFeatures.insert(cfg.lastFullVersionBuild.1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let iapReceipts = receipt.inAppPurchaseReceipts {
|
if let iapReceipts = receipt.inAppPurchaseReceipts {
|
||||||
|
|
Loading…
Reference in New Issue