Only add iOS-type devices to profile (#84)
- Commit
8f31686c926f0450d1490cf1d67307ec1ea0d970- Author
- Kabir Oberai <[email protected]>
- When
- 2025-05-23 19:26 UTC (1 year ago)
- Parents
3b17975
Another tentative fix for #64
Diff
Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift
diff --git a/Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift b/Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swiftindex 1d20ade..daafb22 100644--- a/Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift+++ b/Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift@@ -71,6 +71,7 @@ public struct DeveloperServicesFetchProfileOperation: DeveloperServicesOperation let allDevices = try await context.developerAPIClient.devicesGetCollection() .ok.body.json.data+ .filter { $0.attributes?.deviceClass?.value1?.supportsIOSApps == true } let response = try await context.developerAPIClient.profilesCreateInstance( body: .json(@@ -106,3 +107,12 @@ public struct DeveloperServicesFetchProfileOperation: DeveloperServicesOperation } }++extension Components.Schemas.Device.AttributesPayload.DeviceClassPayload.Value1Payload {+ fileprivate var supportsIOSApps: Bool {+ switch self {+ case .ipad, .iphone, .ipod: true+ default: false+ }+ }+}