mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-16 12:31:40 +03:00
Only add iOS-type devices to profile
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user