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