Samir K
Samir K

Reputation: 91

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. So incase the user's accidentally uninstall the app they can still retrieve it from their iCloud storage. The question being:

  1. What's the general approach to saving/backing app data to the iCloud using Cloudkit? 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? Does iCloud have a different container allotted to each individual app or is it the same as the user's iCloud storage container?

Thank you for your time.

Upvotes: 0

Views: 843

Answers (1)

user3069232
user3069232

Reputation: 8995

Samir,

Looking up error messages on iCloud I find several errors relating to space usage.

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.

Which suggests if you try and save someone's data to iCloud and they don't have space, it won't work.

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.

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. No asking your user if they want to save to iCloud, is surely a best practice.

Upvotes: 1

Related Questions