TelemetryDeck / SwiftSDK

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

macCatalyst version numbers are wrong #106

Open michaellenaghan opened 1 year ago

michaellenaghan commented 1 year ago

SwiftClient is reporting the wrong macCatalyst version numbers here, here and here. Take a look a this screenshot from the dashboard:

Screenshot 2023-05-19 at 1 50 25 PM

macCatalyst runs on macOS, and they each have their own version numbers. macCatalyst version numbers should correspond to iOS versions, though, not macOS versions as they do above. See, for example, the availability info for Widget in Apple's docs:

Screenshot 2023-05-19 at 2 11 34 PM

Notice how the iOS and macCatalyst versions match, and how the macOS version is lower.

So what the screenshot shows as macCatalyst 13.3 is most likely, in fact, macCatalyst 16.4 (running on macOS 13.3).

The reason this matters is that in development we often have to use #available. Someone making a decision based on TelemetryDeck's reporting could accidentally use the wrong version number.

I nearly did that today!

I already had system reporting code in my own app. Here's what it looks like:

    private func deviceSummary() -> String {
        if processInfo.isiOSAppOnMac {
            if processInfo.isMacCatalystApp {
                return
                    "iOS on Mac (\(uiDevice.systemName) \(uiDevice.systemVersion) running on macOS \(processInfo.operatingSystemVersionMajor).\(processInfo.operatingSystemVersionMinor).\(processInfo.operatingSystemVersionPatch))"
            }
        }
        if processInfo.isMacCatalystApp {
            return
                "Mac (\(uiDevice.systemName) \(uiDevice.systemVersion) running on macOS \(processInfo.operatingSystemVersionMajor).\(processInfo.operatingSystemVersionMinor).\(processInfo.operatingSystemVersionPatch))"
        }
        return "\(uiDevice.model) (\(uiDevice.systemName) \(uiDevice.systemVersion))"
    }

And this is what it produces on my Mac:

Screenshot 2023-05-19 at 2 06 49 PM
narendrajagne commented 9 months ago

His, Can you assign me this issue ?

winsmith commented 9 months ago

Sure, here you go!

narendrajagne commented 9 months ago

Yes