Automattic / Automattic-Tracks-iOS

Client library for tracking user events for later analysis
GNU General Public License v2.0
41 stars 12 forks source link

Make Mac OS version parsable #203

Closed MichelleTessier closed 2 years ago

MichelleTessier commented 2 years ago

Previously we were recording the [[NSProcessInfo processInfo] operatingSystemVersionString] as the os version, but this is a localized string that is not fit for parsing. (It reads like Version 12.2.1 (Build 21D62), where version and build are localized).

Instead, use [[NSProcessInfo processInfo] operatingSystemVersion], and record our own non-localized string instead. Will record version like 12.2.1.

Fixes https://github.com/bloom/DayOne-iOS/issues/18755

I tested this by by putting a breakpoint in TracksSevice, line 146, running TracksDemo Mac on my Mac, and then printing out self.deviceInformation.version and verifying that it was the same as my Mac OS version.

If you want to test like this you'll need to add the Sentry DSN in Secrets.sentryDSN. You can find this by searching for macOSSentryDSN in the Day One project.