Don't show add account option for CloudKit when the entitlement isn't present.
This commit is contained in:
parent
25882f69c8
commit
53b00c5414
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -67,5 +67,7 @@
|
||||
<string>NetNewsWire (RSS Reader; https://ranchero.com/netnewswire/)</string>
|
||||
<key>OrganizationIdentifier</key>
|
||||
<string>$(ORGANIZATION_IDENTIFIER)</string>
|
||||
<key>DeveloperEntitlements</key>
|
||||
<string>$(DEVELOPER_ENTITLEMENTS)</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -4,6 +4,8 @@
|
||||
<dict>
|
||||
<key>OrganizationIdentifier</key>
|
||||
<string>$(ORGANIZATION_IDENTIFIER)</string>
|
||||
<key>DeveloperEntitlements</key>
|
||||
<string>$(DEVELOPER_ENTITLEMENTS)</string>
|
||||
<key>AppGroup</key>
|
||||
<string>group.$(ORGANIZATION_IDENTIFIER).NetNewsWire.iOS</string>
|
||||
<key>AppIdentifierPrefix</key>
|
||||
|
Loading…
x
Reference in New Issue
Block a user