diff --git a/Sources/WordPressKit/Models/SessionDetails.swift b/Sources/WordPressKit/Models/SessionDetails.swift index 46f4df45..dc36e0fb 100644 --- a/Sources/WordPressKit/Models/SessionDetails.swift +++ b/Sources/WordPressKit/Models/SessionDetails.swift @@ -4,6 +4,7 @@ public struct SessionDetails { let buildNumber: String let marketingVersion: String let identifier: String + let osVersion: String } extension SessionDetails: Encodable { @@ -14,6 +15,7 @@ extension SessionDetails: Encodable { case buildNumber = "build_number" case marketingVersion = "marketing_version" case identifier = "identifier" + case osVersion = "os_version" } init(deviceId: String, bundle: Bundle = .main) { @@ -22,6 +24,7 @@ extension SessionDetails: Encodable { self.buildNumber = bundle.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown" self.marketingVersion = bundle.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" self.identifier = bundle.bundleIdentifier ?? "Unknown" + self.osVersion = UIDevice.current.systemVersion } func dictionaryRepresentation() throws -> [String: AnyObject]? { diff --git a/Tests/WordPressKitTests/Tests/DashboardServiceRemoteTests.swift b/Tests/WordPressKitTests/Tests/DashboardServiceRemoteTests.swift index 86d62c61..8e6e60c0 100644 --- a/Tests/WordPressKitTests/Tests/DashboardServiceRemoteTests.swift +++ b/Tests/WordPressKitTests/Tests/DashboardServiceRemoteTests.swift @@ -23,7 +23,8 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable { "marketing_version", "device_id", "cards", - "locale" + "locale", + "os_version", ] stubRemoteResponse({ req in diff --git a/Tests/WordPressKitTests/Tests/Utilities/FeatureFlagRemoteTests.swift b/Tests/WordPressKitTests/Tests/Utilities/FeatureFlagRemoteTests.swift index c84197e7..602d8957 100644 --- a/Tests/WordPressKitTests/Tests/Utilities/FeatureFlagRemoteTests.swift +++ b/Tests/WordPressKitTests/Tests/Utilities/FeatureFlagRemoteTests.swift @@ -15,7 +15,8 @@ class FeatureFlagRemoteTests: RemoteTestCase, RESTTestable { "platform", "build_number", "marketing_version", - "device_id" + "device_id", + "os_version", ] stub { req -> Bool in