Clean up and rename beta receipt variables
This commit is contained in:
parent
56fb220c94
commit
b52e3c779b
|
@ -37,8 +37,8 @@ extension BundleConfiguration {
|
|||
cachesURL.appending(path: Constants.shared.log.tunnelPath)
|
||||
}
|
||||
|
||||
public static var urlForAppGroupReceipt: URL {
|
||||
cachesURL.appending(path: Constants.shared.tunnel.appGroupReceiptPath)
|
||||
public static var urlForBetaReceipt: URL {
|
||||
cachesURL.appending(path: Constants.shared.tunnel.betaReceiptPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public struct Constants: Decodable, Sendable {
|
|||
|
||||
public let refreshInterval: TimeInterval
|
||||
|
||||
public let appGroupReceiptPath: String
|
||||
public let betaReceiptPath: String
|
||||
}
|
||||
|
||||
public struct API: Decodable, Sendable {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"tunnel": {
|
||||
"profileTitleFormat": "Passepartout: %@",
|
||||
"refreshInterval": 3.0,
|
||||
"appGroupReceiptPath": "app-group-receipt"
|
||||
"betaReceiptPath": "beta-receipt"
|
||||
},
|
||||
"api": {
|
||||
"timeoutInterval": 5.0
|
||||
|
|
|
@ -117,7 +117,7 @@ private extension AppContext {
|
|||
|
||||
// copy release receipt to tunnel for TestFlight eligibility (once is enough, it won't change)
|
||||
if let appReceiptURL = Bundle.main.appStoreProductionReceiptURL {
|
||||
let tunnelReceiptURL = BundleConfiguration.urlForAppGroupReceipt
|
||||
let tunnelReceiptURL = BundleConfiguration.urlForBetaReceipt
|
||||
do {
|
||||
pp_log(.App.iap, .info, "Copy release receipt to tunnel...")
|
||||
try? FileManager.default.removeItem(at: tunnelReceiptURL)
|
||||
|
|
|
@ -107,18 +107,13 @@ private extension Configuration.IAPManager {
|
|||
}
|
||||
return FallbackReceiptReader(
|
||||
main: StoreKitReceiptReader(),
|
||||
beta: releaseReceiptURL.map {
|
||||
beta: betaReceiptURL.map {
|
||||
KvittoReceiptReader(url: $0)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
static var releaseReceiptURL: URL? {
|
||||
guard let url = Bundle.main.appStoreReceiptURL else {
|
||||
return nil
|
||||
}
|
||||
return url
|
||||
.deletingLastPathComponent()
|
||||
.appendingPathComponent("receipt") // release receipt
|
||||
static var betaReceiptURL: URL? {
|
||||
Bundle.main.appStoreProductionReceiptURL
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,11 +42,11 @@ private extension Configuration.IAPManager {
|
|||
static var tunnelReceiptReader: AppReceiptReader {
|
||||
FallbackReceiptReader(
|
||||
main: StoreKitReceiptReader(),
|
||||
beta: KvittoReceiptReader(url: appGroupReceiptURL)
|
||||
beta: KvittoReceiptReader(url: betaReceiptURL)
|
||||
)
|
||||
}
|
||||
|
||||
static var appGroupReceiptURL: URL {
|
||||
BundleConfiguration.urlForAppGroupReceipt // copied by ProfileProcessor
|
||||
static var betaReceiptURL: URL {
|
||||
BundleConfiguration.urlForBetaReceipt // copied by AppContext.onLaunch
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue