简体   繁体   English

当存储空间已满时,将应用程序数据保存到用户的iCloud(CloudKit)吗?

[英]Saving app data to the user's iCloud(CloudKit) when the storage is full?

This is more of a theoretical/approach question. 这更多是一个理论/方法问题。 So I have an app that needs to save/backup data to the iCloud. 因此,我有一个需要将数据保存/备份到iCloud的应用程序。 So incase the user's accidentally uninstall the app they can still retrieve it from their iCloud storage. 因此,如果用户意外卸载了该应用程序,他们仍然可以从其iCloud存储中检索该应用程序。 The question being: 问题是:

  1. What's the general approach to saving/backing app data to the iCloud using Cloudkit? 使用Cloudkit将应用程序数据保存/备份到iCloud的一般方法是什么? Should the data be saved automatically or let the user's decide that on the click of a button? 数据应该自动保存还是让用户通过单击按钮来决定?
  2. If I go with automatic backing up of data everytime the user enter's the app what happens if the user's iCloud storage is full? 如果我每次用户输入应用程序时都会自动备份数据,那么如果用户的iCloud存储空间已满怎么办? Does iCloud have a different container allotted to each individual app or is it the same as the user's iCloud storage container? iCloud是否为每个单独的应用程序分配了不同的容器,或者与用户的iCloud存储容器相同?

Thank you for your time. 感谢您的时间。

Samir, 萨米尔,

Looking up error messages on iCloud I find several errors relating to space usage. 在iCloud上查找错误消息,我发现一些与空间使用有关的错误。

https://developer.apple.com/documentation/foundation/icloud/icloud_error_codes https://developer.apple.com/documentation/foundation/icloud/icloud_error_codes

In particular this one ... 特别是这个...

var NSUbiquitousFileNotUploadedDueToQuotaError: Int The item could not be uploaded to iCloud because it would make the account go over its quota. var NSUbiquitousFileNotUploadedDueToQuotaError:Int无法将该项目上传到iCloud,因为它将使帐户超出其配额。

Which suggests if you try and save someone's data to iCloud and they don't have space, it won't work. 这表明如果您尝试将某人的数据保存到iCloud并且他们没有空间,那将无法正常工作。

The other question really relates to Apple's guideline on this, they ask/suggest you make sure you use the other users iCloud space responsibly. 另一个问题确实与Apple的准则有关,他们询问/建议您确保以负责任的方式使用其他用户iCloud空间。

Is saving data automatically do so ... maybe not, depending on how much data we're talking about really. 自动保存数据会这样做……也许不是,这取决于我们实际上在谈论多少数据。 If I downloaded an app and it started to silently write to my iCloud drive I wouldn't too impressed when I found out. 如果我下载了一个应用程序,并且它开始以静默方式写入我的iCloud驱动器,当我发现它时不会太感动。 No asking your user if they want to save to iCloud, is surely a best practice. 最好不要问您的用户是否要将其保存到iCloud。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM