From e4048b7bb371823a3b37d1e033d269ef772425ec Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Sat, 24 May 2025 00:48:43 +0530 Subject: [PATCH] Only add iOS-type devices to profile --- .../DeveloperServicesFetchProfileOperation.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift b/Sources/XKit/DeveloperServices/Profiles/DeveloperServicesFetchProfileOperation.swift index 1d20adef..daafb229 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 + } + } +}