如果用户未启用iCloud Drive,CloudKit的应用程序会受到哪些限制

Ján*_*nos 5 ios cloudkit icloud-drive

如果用户未打开iCloud Drive,哪些CloudKit服务不可用?

是否有办法从应用程序打开iCloud Drive?

我想从公共容器下载记录应该可以工作,无论iCloud Drive,只有在启用时才写入容器?!

pow*_*old 8

以下是Apple暗示CloudKit需要iCloud Drive的地方:

在保存记录之前,通过验证用户是否已登录其iCloud帐户来改善用户体验.如果用户未登录,则会发出警报,指示用户如何输入其iCloud凭据并启用iCloud Drive.在下面的else子句中插入保存记录的代码.

https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloudKitQuickStart/CreatingaSchemabySavingRecords/CreatingaSchemabySavingRecords.html#//apple_ref/doc/uid/TP40014987-CH3-SW8


Edw*_*eer -2

CloudKit 链接到 iCloud 帐户。如果用户登录 iCloud,但未启用 iCloudDrive,则 CloudKit 没有限制。

如果用户没有登录iCloud,那么他只能访问公共数据。您可以在 CloudKit 仪表板中的任何记录类型上设置此项。

无法从您的应用程序内更改登录信息。您只能从设置应用程序登录。也无法从您的应用程序启用 iCloud Drive。为此,您还需要转到设置应用程序

  • 抱歉,你错了,我刚刚重新测试了一下,如果 iCloud Drive 关闭,则会发生 3 件事 (1) `accountStatusWithCompletionHandler` 将返回 `.NoAccount` (2) `NSFileManager.defaultManager().ubiquityIdentityToken` 值为 `nil ` 和 (3) `publicDatabase.saveRecord` 方法将返回错误。因此,iCloud Drive 是使用 CloudKit 的严格限制,也是一个严重的威胁。http://stackoverflow.com/questions/34115648/default-state-of-icloud-drive-setting-for-a-newly-installed-app (4认同)