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
|
// MARK: Private
|
||||||
|
|
||||||
private extension AccountsAddViewController {
|
private extension AccountsAddViewController {
|
||||||
|
|
||||||
func removeCloudKitIfNecessary() {
|
func removeCloudKitIfNecessary() {
|
||||||
if let index = AccountManager.shared.activeAccounts.firstIndex(where: { $0.type == .cloudKit }) {
|
func removeCloudKit() {
|
||||||
addableAccountTypes.remove(at: index)
|
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>
|
<string>NetNewsWire (RSS Reader; https://ranchero.com/netnewswire/)</string>
|
||||||
<key>OrganizationIdentifier</key>
|
<key>OrganizationIdentifier</key>
|
||||||
<string>$(ORGANIZATION_IDENTIFIER)</string>
|
<string>$(ORGANIZATION_IDENTIFIER)</string>
|
||||||
|
<key>DeveloperEntitlements</key>
|
||||||
|
<string>$(DEVELOPER_ENTITLEMENTS)</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>OrganizationIdentifier</key>
|
<key>OrganizationIdentifier</key>
|
||||||
<string>$(ORGANIZATION_IDENTIFIER)</string>
|
<string>$(ORGANIZATION_IDENTIFIER)</string>
|
||||||
|
<key>DeveloperEntitlements</key>
|
||||||
|
<string>$(DEVELOPER_ENTITLEMENTS)</string>
|
||||||
<key>AppGroup</key>
|
<key>AppGroup</key>
|
||||||
<string>group.$(ORGANIZATION_IDENTIFIER).NetNewsWire.iOS</string>
|
<string>group.$(ORGANIZATION_IDENTIFIER).NetNewsWire.iOS</string>
|
||||||
<key>AppIdentifierPrefix</key>
|
<key>AppIdentifierPrefix</key>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user