Skip to content

Commit 8f31686

Browse files
authored
Only add iOS-type devices to profile (#84)
Another tentative fix for #64
1 parent 3b17975 commit 8f31686

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public struct DeveloperServicesFetchProfileOperation: DeveloperServicesOperation
7171

7272
let allDevices = try await context.developerAPIClient.devicesGetCollection()
7373
.ok.body.json.data
74+
.filter { $0.attributes?.deviceClass?.value1?.supportsIOSApps == true }
7475

7576
let response = try await context.developerAPIClient.profilesCreateInstance(
7677
body: .json(
@@ -106,3 +107,12 @@ public struct DeveloperServicesFetchProfileOperation: DeveloperServicesOperation
106107
}
107108

108109
}
110+
111+
extension Components.Schemas.Device.AttributesPayload.DeviceClassPayload.Value1Payload {
112+
fileprivate var supportsIOSApps: Bool {
113+
switch self {
114+
case .ipad, .iphone, .ipod: true
115+
default: false
116+
}
117+
}
118+
}

0 commit comments

Comments
 (0)