Skip to content

Commit

Permalink
Merge pull request #38 from jazzychad/jc/debugVsTestFlight
Browse files Browse the repository at this point in the history
Differentiates DEBUG and TestFlight builds. Resolves #26
  • Loading branch information
winsmith authored Aug 13, 2021
2 parents 9ccd345 + eb98700 commit d4e89df
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/TelemetryClient/Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ internal struct SignalPayload: Codable {
var appVersion: String = Self.appVersion
var buildNumber: String = Self.buildNumber
var isSimulator: String = "\(Self.isSimulator)"
var isDebug: String = "\(Self.isDebug)"
var isTestFlight: String = "\(Self.isTestFlight)"
var isAppStore: String = "\(Self.isAppStore)"
var modelName: String = Self.modelName
Expand Down Expand Up @@ -77,8 +78,16 @@ extension SignalPayload {
#endif
}

static var isDebug: Bool {
#if DEBUG
return true
#else
return false
#endif
}

static var isTestFlight: Bool {
guard let path = Bundle.main.appStoreReceiptURL?.path else {
guard !isDebug, let path = Bundle.main.appStoreReceiptURL?.path else {
return false
}
return path.contains("sandboxReceipt")
Expand Down

0 comments on commit d4e89df

Please sign in to comment.