From de09bb99ebf7164c2b49267e8b513a6583e241d6 Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Mon, 12 May 2025 17:59:18 +0530 Subject: [PATCH] Fix App ID capabilities on paid accounts --- .../App IDs/DeveloperServicesAddAppOperation.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift b/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift index 11217775..90684f8a 100644 --- a/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift +++ b/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift @@ -104,9 +104,13 @@ public struct DeveloperServicesAddAppOperation: DeveloperServicesOperation { .ok } } else { - _ = try await context.developerAPIClient - .bundleIdCapabilitiesDeleteInstance(path: .init(id: cap.id)) - .noContent + // DeveloperServices doesn't allow deleting these capabilities + let requiredCapabilities: Set = [.inAppPurchase] + if let capType = cap.attributes?.capabilityType, !requiredCapabilities.contains(capType) { + _ = try await context.developerAPIClient + .bundleIdCapabilitiesDeleteInstance(path: .init(id: cap.id)) + .noContent + } } } for (typ, settings) in wantedCapabilities {