Skip to content

Commit de09bb9

Browse files
committed
Fix App ID capabilities on paid accounts
1 parent 4f5cc87 commit de09bb9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ public struct DeveloperServicesAddAppOperation: DeveloperServicesOperation {
104104
.ok
105105
}
106106
} else {
107-
_ = try await context.developerAPIClient
108-
.bundleIdCapabilitiesDeleteInstance(path: .init(id: cap.id))
109-
.noContent
107+
// DeveloperServices doesn't allow deleting these capabilities
108+
let requiredCapabilities: Set<Components.Schemas.CapabilityType> = [.inAppPurchase]
109+
if let capType = cap.attributes?.capabilityType, !requiredCapabilities.contains(capType) {
110+
_ = try await context.developerAPIClient
111+
.bundleIdCapabilitiesDeleteInstance(path: .init(id: cap.id))
112+
.noContent
113+
}
110114
}
111115
}
112116
for (typ, settings) in wantedCapabilities {

0 commit comments

Comments
 (0)