diff options
author | Ryan Wilson <wilsonryan@google.com> | 2018-04-16 19:29:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 19:29:53 -0400 |
commit | ad321bb27910cec49f15b4ece124448d9fcf6b5c (patch) | |
tree | e2227659fa1b5af6aae27a0f766eef2db69dfbb2 /Firebase/Core | |
parent | 360e58901c359d7d21da4fff8043894c843427b7 (diff) |
Match previous systemVersion functionality (#1120)
* Match previous systemVersion functionality
* style.sh
* Add new test file to test targets
Diffstat (limited to 'Firebase/Core')
-rw-r--r-- | Firebase/Core/third_party/FIRAppEnvironmentUtil.m | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m index faee38b..8e76201 100644 --- a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m +++ b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m @@ -204,7 +204,18 @@ static BOOL isAppEncrypted() { } + (NSString *)systemVersion { - return [NSProcessInfo processInfo].operatingSystemVersionString; + // Assemble the systemVersion, excluding any insignificant digits. + NSOperatingSystemVersion osVersion = [NSProcessInfo processInfo].operatingSystemVersion; + NSMutableString *versionString = [[NSMutableString alloc] initWithFormat:@"%ld", (long)osVersion.majorVersion]; + if (osVersion.minorVersion != 0) { + [versionString appendFormat:@".%ld", (long)osVersion.minorVersion]; + } + + if (osVersion.patchVersion != 0) { + [versionString appendFormat:@".%ld", (long)osVersion.patchVersion]; + } + + return versionString; } + (BOOL)isAppExtension { |