Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip local receipt on Apple TV #1041

Merged
merged 2 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ public actor FallbackReceiptReader: AppReceiptReader {

private extension FallbackReceiptReader {
func asyncReceipt(at userLevel: AppUserLevel) async -> InAppReceipt? {
pp_log(.App.iap, .debug, "\tParse receipt for user level \(userLevel)")
pp_log(.App.iap, .info, "\tParse receipt for user level \(userLevel)")
if userLevel == .beta, let betaReader {
pp_log(.App.iap, .debug, "\tTestFlight, read beta receipt")
pp_log(.App.iap, .info, "\tTestFlight, read beta receipt")
if let receipt = await betaReader.receipt() {
return receipt
}
pp_log(.App.iap, .info, "\tTestFlight, no beta receipt found!")
}
pp_log(.App.iap, .debug, "\tProduction, read main receipt")
pp_log(.App.iap, .info, "\tProduction, read main receipt")
return await mainReader.receipt()
}
}
4 changes: 4 additions & 0 deletions Passepartout/App/Context/AppContext+Shared.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@ private extension Dependencies {
}

var betaReceiptURL: URL? {
#if os(tvOS)
nil
#else
Bundle.main.appStoreProductionReceiptURL
#endif
}

var mirrorsRemoteRepository: Bool {
Expand Down
6 changes: 3 additions & 3 deletions Passepartout/Tunnel/Context/TunnelContext+Shared.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ private extension Dependencies {
}

var betaReceiptURL: URL? {
#if !os(tvOS)
BundleConfiguration.urlForBetaReceipt // copied by AppContext.onLaunch
#else
#if os(tvOS)
nil
#else
BundleConfiguration.urlForBetaReceipt // copied by AppContext.onLaunch
#endif
}
}