Skip to content

Commit

Permalink
Adds os_version parameter to feature flags and dashboard cards apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonis Lilis committed Jun 6, 2024
1 parent 41bda2a commit 789eb72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Sources/WordPressKit/Models/SessionDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public struct SessionDetails {
let buildNumber: String
let marketingVersion: String
let identifier: String
let osVersion: String
}

extension SessionDetails: Encodable {
Expand All @@ -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) {
Expand All @@ -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]? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class DashboardServiceRemoteTests: RemoteTestCase, RESTTestable {
"marketing_version",
"device_id",
"cards",
"locale"
"locale",
"os_version",
]

stubRemoteResponse({ req in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class FeatureFlagRemoteTests: RemoteTestCase, RESTTestable {
"platform",
"build_number",
"marketing_version",
"device_id"
"device_id",
"os_version",
]

stub { req -> Bool in
Expand Down

0 comments on commit 789eb72

Please sign in to comment.