用户可以访问使用 Key/Value 存储在 iCloud 中的数据吗?

Is data stored in iCloud using Key/Value accessible by users?

我有一个应用程序在 iCloud 中使用 Key/Value 对实现存储。从我在 documentation 中读到的内容来看,这与 NSUserDefaults 的工作方式几乎相同。

然而,这可能会产生问题,因为用户不应该能够篡改存储在其中的应用数据。这是否意味着用户可以访问此数据并对其进行修改?还是应用程序私有?

好的,深入阅读它所说的文档

If your app needs to store passwords, do not use iCloud storage APIs for that. The correct API for storing and managing passwords is Keychain Services, as described in Keychain Services Reference.

我发现这段文字 here 就在最后一行 table 之前的一行 :)

我在某处还发现用户可以手动删除他的iCloud数据,这也算是一种修改。

另外,请阅读 here 的第 "Start Fresh If Your iCloud Data Becomes Inconsistent During Development" 部分,其中说明了如何清洁容器。也许你可以检查里面有什么是可见的。

这取决于您在 iCloud 中存储的数据类型,如果它是敏感的,那么我会使用 keychain services 方法并避免在 iCloud 上存储敏感信息。

从问题来看,您似乎是以 key-value 对的形式存储数据,通常,建议存储首选项、设置和简单的应用程序状态,这应该没问题,因为用户可以更改这些,你should choose the right iCloud API for what you want to store

使用 iCloud,用户可以随时删除它存储的信息,如 documentation

中所述

There may be times when a user wants to delete content from iCloud. Provide UI to help your users understand that deleting a document from iCloud removes it from the user’s iCloud account and from all of their iCloud-enabled devices. Provide users with the opportunity to confirm or cancel deletion

当你问

Or is it private to the application?

您的权利文件中有一个 iCloud 标识符。如果这两个应用程序中的相同,您将能够在两个应用程序中访问相同的 data/documents。

希望对您有所帮助。