I’m trying to understand which storage capacity key is the correct one to use when deciding whether my app can start downloading offline video content.
I read the documentation here: https://developer.apple.com/documentation/foundation/checking-volume-storage-capacity
but I still don’t fully understand the intended usage difference between:
- volumeAvailableCapacityKey
- volumeAvailableCapacityForImportantUsageKey
My app allows users to download videos for offline viewing. These downloads may remain on the device for a long time (days or even months), so they are not just temporary cache files.
On one hand, this seems to match the description of “storing data based on a user request”, which suggests using volumeAvailableCapacityForImportantUsageKey.
On the other hand, my understanding is that this value may assume the system is willing to aggressively purge caches and reclaim space for this “important usage”. I’m worried this could lead to unexpected or unpleasant side effects for the user if my app relies on that space.
What confuses me even more is that the values are significantly different on my device:
- iPhone Settings reports about 142 GB free
- volumeAvailableCapacityKey returns only ~56 GB
- volumeAvailableCapacityForImportantUsageKey returns ~132 GB
So my question is:
For an app that downloads videos for offline playback — where the user explicitly requested the download, but the content may stay on device for a long time — which value is the recommended one to use when deciding whether there is enough free space to start the download?
Should offline media downloads generally be treated as “important usage” in the sense intended by this API?