Let me clairify… You’re more than free to write to system.DocumentsDirectory. Apple doesn’t mind as long as you follow the rules. The main thing you need to understand is that system.DocumentsDirectory gets backed up to iCloud automatically. Users don’t want their iCloud quote being taken up by junk files your app downloads or creates. They only want the important parts that need backed up (i.e. settings, account info). Because of that, Apple has these rules.
1. If it can be downloaded, it needs to go to system.CachesDirectory. The idea is if it gets cleared off of the device, it can be fetched again. No need to back this stuff up.
- If it’s big, or does not need to be backed up, you have to set a flag on the file so that iCloud won’t back it up. See: http://docs.coronalabs.com/api/library/native/setSync.html
Apple will reject your app if you write large files out (I don’t know what “Large” is…) that are not marked as “Don’t back up”. They will reject you if downloaded files go to system.DocumentsDirectory if they can be retrieved again (99.9% of the time they can)
How to deal with this for Android? Well Android doesn’t have these rules. system.CachesDirectory is actually mapped to system.TemporaryDirectory. All you have to do is put a test in when you save files that checks to see if your iOS and do it one way, or if you’re on Android do it the other.
Rob