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:
parent
6b0a08a189
commit
c8de4605a1
|
@ -46,9 +46,7 @@ public final class SandboxChecker: ObservableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func isSandboxBuild() async -> Bool {
|
private func isSandboxBuild() async -> Bool {
|
||||||
#if os(iOS)
|
#if targetEnvironment(macCatalyst) || os(macOS)
|
||||||
bundle.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
|
|
||||||
#elseif targetEnvironment(macCatalyst) || os(macOS)
|
|
||||||
var status = noErr
|
var status = noErr
|
||||||
|
|
||||||
var code: SecStaticCode?
|
var code: SecStaticCode?
|
||||||
|
@ -79,6 +77,8 @@ public final class SandboxChecker: ObservableObject {
|
||||||
requirement
|
requirement
|
||||||
)
|
)
|
||||||
return status == errSecSuccess
|
return status == errSecSuccess
|
||||||
|
#elseif os(iOS)
|
||||||
|
bundle.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
|
||||||
#else
|
#else
|
||||||
false
|
false
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue