Fix TestFlight sandbox detection on Mac (#354)

The Mac `#if` block must come first because in Catalyst builds, `#if
os(iOS)` holds true, and this is not the condition we want to validate
on Catalyst.
This commit is contained in:
Davide De Rosa 2023-09-10 08:08:26 +02:00 committed by GitHub
parent 6b0a08a189
commit c8de4605a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -46,9 +46,7 @@ public final class SandboxChecker: ObservableObject {
}
private func isSandboxBuild() async -> Bool {
#if os(iOS)
bundle.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
#elseif targetEnvironment(macCatalyst) || os(macOS)
#if targetEnvironment(macCatalyst) || os(macOS)
var status = noErr
var code: SecStaticCode?
@ -79,6 +77,8 @@ public final class SandboxChecker: ObservableObject {
requirement
)
return status == errSecSuccess
#elseif os(iOS)
bundle.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
#else
false
#endif