diff --git a/Mac/Preferences/Accounts/AccountsAddViewController.swift b/Mac/Preferences/Accounts/AccountsAddViewController.swift index 5ef19c9fe..4923272be 100644 --- a/Mac/Preferences/Accounts/AccountsAddViewController.swift +++ b/Mac/Preferences/Accounts/AccountsAddViewController.swift @@ -160,9 +160,23 @@ extension AccountsAddViewController: OAuthAccountAuthorizationOperationDelegate // MARK: Private private extension AccountsAddViewController { + func removeCloudKitIfNecessary() { - if let index = AccountManager.shared.activeAccounts.firstIndex(where: { $0.type == .cloudKit }) { - addableAccountTypes.remove(at: index) + func removeCloudKit() { + if let cloudKitIndex = addableAccountTypes.firstIndex(of: .cloudKit) { + addableAccountTypes.remove(at: cloudKitIndex) + } + } + + if AccountManager.shared.activeAccounts.firstIndex(where: { $0.type == .cloudKit }) != nil { + removeCloudKit() + return + } + + // We don't want developers without entitlements to be trying to add the CloudKit account + if let dev = Bundle.main.object(forInfoDictionaryKey: "DeveloperEntitlements") as? String, dev == "-dev" { + removeCloudKit() } } + } diff --git a/Mac/Resources/Info.plist b/Mac/Resources/Info.plist index a0ecd0ec5..85ebc9ae8 100644 --- a/Mac/Resources/Info.plist +++ b/Mac/Resources/Info.plist @@ -67,5 +67,7 @@ NetNewsWire (RSS Reader; https://ranchero.com/netnewswire/) OrganizationIdentifier $(ORGANIZATION_IDENTIFIER) + DeveloperEntitlements + $(DEVELOPER_ENTITLEMENTS) diff --git a/iOS/Resources/Info.plist b/iOS/Resources/Info.plist index 3c6fd3c9a..9251a4909 100644 --- a/iOS/Resources/Info.plist +++ b/iOS/Resources/Info.plist @@ -4,6 +4,8 @@ OrganizationIdentifier $(ORGANIZATION_IDENTIFIER) + DeveloperEntitlements + $(DEVELOPER_ENTITLEMENTS) AppGroup group.$(ORGANIZATION_IDENTIFIER).NetNewsWire.iOS AppIdentifierPrefix