Apple just rejected a PhoneGap app I submitted. I utilize HTML5 localStorage in the app to save downloaded data for caching purposes: 2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected.
I'm seriously confused because if anything I thought localStorage in 5.1 actually saves data in cache and NOT in a place that gets backed up with iCloud [source]. This is the behavior I want - I don't need or want the data to be backed up.
Am I wrong or is Apple? What can I do in a PhoneGap app to save this cached data without being in violation?
Edit: PhoneGap 1.8.1 if that helps.
There are two things that I am aware of:
1) Files that are generated by your app (and not a result of the user using your app) such as temporary text files to store a variable's value, then these files must be placed in the Library/Cache instead of the Document directory.
2) You must also mark a file with a "skip-backup" attribute to tell iCloud not to backup the file.
I think you might be missing step 2.
I wrote a simple MediaDirectory class which quickly gives me the path to the files in the Library/Cache folder and also add the skip backup attribute.
After you saved your file to the Libary/Cache folder, you simply go something like this:
Here's the class in full:
A phonegap app I just submitted has been rejected by apple for the same reasons, and I'm only using localstorage.
I have resubmitted with the following preference set in my config.xml
I understand this will resolve the issue
It turns out I was right and Apple was wrong. I confirmed that I was storing everything in the /Caches directory properly. They didn't comment on my question - just approved my app.