ios - com.apple.developer.icloud-container-identifiers 和 com.apple.developer.ubiquity-kvstore-identifier 之间的区别

标签 ios swift core-data icloud cloudkit

有人知道这两个授权 key 之间的区别吗?

Apple 在不同地方的文档说两者都是为了同一件事:启用 iCloud 文档存储。

最佳答案

com.apple.developer.icloud-container-identifiers 的值指定您的应用在生产环境中使用的 iCloud 容器 ID。

不要与 com.apple.developer.icloud-container-development-container-identifiers 的值混淆,后者指定您的应用程序在开发/暂存中使用的 iCloud 容器 ID。

一些 iCloud 容器用于键值存储,其他 iCloud 容器用于文档存储,其他的用于核心数据存储等。所以 com.apple.developer.ubiquity-kvstore-identifier 是用于指定仅用于键值存储的容器 ID。

这个例子应该说明:

<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>4ZX4Z3MVHG.*</string>

<key>com.apple.developer.icloud-container-identifiers</key>
<array>
    <string>iCloud.com.appleseedinc.MyProject</string>
    <string>iCloud.com.appleseedinc.container1</string>
</array>

请参阅 relevant Apple Tech Note 中的完整示例.

关于ios - com.apple.developer.icloud-container-identifiers 和 com.apple.developer.ubiquity-kvstore-identifier 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66896825/

相关文章:

ios - 使用带有来自设备的 avfoundation 的 swift 将 Capture session 保存在文档目录中

ios - 如何在 Swift 代码中正确使用 #ifdef DEBUG/RELEASE 值?

ios - 如何创建一个 NSManagedObjectContext 作为另一个 NSManagedObjectContext 的子集?

ios - 分离的 ViewController 错误

ios - Apple Watch 视频控制

ios - 选取图片并上传

iphone - 核心数据问题 - 检查项目是否存在

swift - 使用 Swift 语言从字节数组创建 NSString 会生成错误的字符

ios - Facebook SDK 分享图片与文字

ios - 奇怪的括号?