I'm using phonegap build to publish apps, and it looks like localstorage is getting cleared on ios devices between updates.
Is there any way to stop or debug this behavior? Aside from web syncing, how do I persist data locally in a durable way?
I'm not observing this behavior on android devices.
It's possible that Apple stores cache like localStorage in either the Caches or tmp directory for your app. If that's the case, then such data is vulnerable to automatic recycling.
According to Marco of Instapaper fame:
Prior to iOS 5, the system never deleted the contents of Caches and tmp, so they were safe places for apps to put data that should
always be available but could be redownloaded if the user did a
complete restore or otherwise lost all data, and therefore shouldn’t
be taking up space in backups and slowing down syncs.
...But in iOS 5, there’s an important change: Caches and tmp — the only two directories that aren’t backed up — are “cleaned” out when
the device is low on space.
Unfortunately this means that the second part of your question -- how to store data without syncing and without it getting cleared between updates -- might be tough if not impossible using Phonegap.
There’s no longer anywhere to store files that don’t need to be backed
up (or can’t be, by the new policy) but shouldn’t be randomly deleted.