From bdcc157adaae23a3dfdbdbee16ed687a04d4672c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Agudo?= Date: Wed, 21 Oct 2026 12:01:40 +0200 Subject: [PATCH] entitlements: support Sign in with Apple Map com.apple.developer.applesignin to the APPLE_ID_AUTH capability as a primary App ID. Before this, syncing the capabilities removed Sign in with Apple from the App ID on every install, so a build with the entitlement could not be installed. --- .../DeveloperServicesCapability.swift | 16 ++++++++++++++++ .../Model/Entitlements/EntitlementTypes.swift | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift index 2dca4637..1d122548 100644 --- a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift +++ b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift @@ -79,6 +79,22 @@ extension AppGroupEntitlement: EntitlementWithCapability { } } +extension AppleSignInEntitlement: EntitlementWithCapability { + var capability: DeveloperServicesCapability { + // A primary App ID: the app is its own Sign in with Apple group. + DeveloperServicesCapability( + .appleIdAuth, + isFree: false, + settings: [ + .init( + key: .init(.appleIdAuthAppConsent), + options: [.init(key: .init(.primaryAppConsent))] + ) + ] + ) + } +} + extension AssociatedDomainsEntitlement: EntitlementWithCapability { var capability: DeveloperServicesCapability { DeveloperServicesCapability(.associatedDomains, isFree: false) diff --git a/Sources/XKit/Model/Entitlements/EntitlementTypes.swift b/Sources/XKit/Model/Entitlements/EntitlementTypes.swift index 1d65a047..7bc1ea5f 100644 --- a/Sources/XKit/Model/Entitlements/EntitlementTypes.swift +++ b/Sources/XKit/Model/Entitlements/EntitlementTypes.swift @@ -29,6 +29,7 @@ extension EntitlementContainer { WiFiAwareEntitlement.self, HomeKitEntitlement.self, HealthKitEntitlement.self, + AppleSignInEntitlement.self, ] } @@ -99,6 +100,21 @@ public struct AssociatedDomainsEntitlement: Entitlement, RawRepresentable { } } +public struct AppleSignInEntitlement: Entitlement, RawRepresentable { + public static let identifier = "com.apple.developer.applesignin" + + public var rawValue: [String] + public init(rawValue: [String]) { self.rawValue = rawValue } + + public init(from decoder: Decoder) throws { + rawValue = try decoder.singleValueContainer().decode([String].self) + } + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + public enum APSEnvironmentEntitlement: String, Entitlement { public static let identifier = "aps-environment"