PhoneGap iOS 7 and localStorage

守給你的承諾、 提交于 2019-12-10 01:52:53

问题


I’m currently building a PhoneGap 3.3.0 iOS application which uses Ember.js/EmberData with a LocalStorage adapter to persist data. After reading some articles like this StackOverflow question I’d like to know how the LocalStorage data is handled by iOS 7. Is it stored permanently or still stored in a cache folder which is note backed up to iTunes/iCloud? Unfortunately, the PhoneGap documentation on LocalStorage only refers to the official W3C spec.

The only thing said about the handling of the web storage is a description of a flag in the config.xml:

BackupWebStorage (string, either none, local, or the default cloud): Set to cloud to allow web storage data to backup via iCloud. Set to local to allow only local backups via iTunes sync. Set to none prevent web storage backups.

<preference name="BackupWebStorage" value="local"/>

The Safari Docs also don’t mention the internals of the LocalStorage implementation and how it is treated in a App update cycle.

I’d really like to know how the LocalStorage data is handled by iOS 7, and maybe if there is a doc on this that I’ve missed, then can someone please point it out to me.


回答1:


If your question is "does local storage persist after app update cycle" I can say yes based on experience with my app.

I have set

<preference name="BackupWebStorage" value="local" />

in the config.xml. I store a journal of I-Ching readings to local storage and have now been through two app update cycles with no user data loss. I don't have any further documentation on the mechanics though.



来源:https://stackoverflow.com/questions/21706286/phonegap-ios-7-and-localstorage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!