PhoneGap iOS 7和localStorage [英] PhoneGap iOS 7 and localStorage

查看:236
本文介绍了PhoneGap iOS 7和localStorage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在构建一个PhoneGap 3.3.0 iOS应用程序,该应用程序使用Ember.js / EmberData和LocalStorage适配器来保存数据。在阅读了一些文章喜欢这个StackOverflow问题后,我想知道如何LocalStorage数据由iOS 7处理。它是永久存储还是仍存储在缓存文件夹中,该文件夹备注到iTunes / iCloud?不幸的是,关于LocalStorage的PhoneGap文档仅涉及官方的W3C规范。

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.

关于处理网络存储的唯一说法是 config.xml中的%20config.xml%0AFilerel =nofollow noreferrer>标志描述

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


BackupWebStorage(字符串,无,本地或默认云):
设置为云以允许通过iCloud备份Web存储数据。设置为
local,仅允许通过iTunes同步进行本地备份。设置为无阻止
网络存储备份。

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 =BackupWebStoragevalue =local/>

Safari Docs 也未提及LocalStorage实现的内部以及如何在App更新周期中对其进行处理。

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

我真的很想知道iOS 7如何处理LocalStorage数据,也许如果有一个我错过的文档,那么有人可以指出给我。

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.

推荐答案

如果你的问题是应用程序更新周期后本地存储是否仍然存在我可以根据经验使用我的应用程序

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

我已设定

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

。我将I-Ching读数的日志存储到本地存储,现在已经过了两个应用程序更新周期,没有用户数据丢失。我没有关于机制的任何进一步文档。

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.

这篇关于PhoneGap iOS 7和localStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆