TelemetryDeck / SwiftSDK

Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
https://telemetrydeck.com/
Other
149 stars 31 forks source link

Signals sent in Debug Build appear as TestFlight in Viewer #26

Closed ekoranek12 closed 2 years ago

ekoranek12 commented 3 years ago

Signals sent from a debug version of the app have their isTestflight value set to true. I think this value should be false. Ideally an isDebug value would also be present.

Setup configuration allowing debug signals:

let configuration = TelemetryManagerConfiguration(appID: "MY_APP_ID")
configuration.telemetryAllowDebugBuilds = true
TelemetryManager.initialize(with: configuration)
TelemetryManager.send("applicationDidFinishLaunching"

Signal Values: Screen Shot 2021-05-28 at 2 38 38 PM

Within my personal iOS project I use this code to identify between Debug/TestFlight/AppStore for various other checks. Maybe it will be helpful for this?

public extension Bundle {
    enum DistributionSource {
        case debug, testFlight, appStore

        public var displayableTitle: String {
            switch self {
            case .debug: return "Debug"
            case .testFlight: return "TestFlight"
            case .appStore: return "App Store"
            }
        }
    }

    static var distributionSource: DistributionSource {
        #if DEBUG
        return .debug
        #else
        let isTestFlight = main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
        return isTestFlight ? .testFlight : .appStore
        #endif
    }
}
winsmith commented 3 years ago

Hi, thanks for reporting this! I'll investigate and get back to you!