应用商店更新后的本地存储清算? [英] Localstorage clearing after app store update?

查看:139
本文介绍了应用商店更新后的本地存储清算?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phonegap build来发布应用程序,看起来localstorage在更新之间在ios设备上被清除。

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?

我没有在Android设备上观察到这种行为。

I'm not observing this behavior on android devices.

推荐答案

Apple可能会将缓存(如localStorage)存储在应用程序的Caches或tmp目录中。如果是这种情况,那么此类数据很容易被自动回收。

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.

根据 Instapaper成名的Marco:

According to Marco of Instapaper fame:


在iOS 5之前,系统永远不会删除Caches和tmp的内容,因此它们是应用程序放置数据的安全位置,应该
始终可用,但如果用户执行
完全恢复或以其他方式丢失所有数据,则可以重新下载,因此不应该
占用备份空间并减慢同步速度。

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.

...但在iOS 5中,有一个重要的变化:缓存和tmp - 只有两个没有备份的目录 - 当
设备空间不足时,清理出来。

...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.

不幸的是,这意味着你问题的第二部分 - 如何在没有同步的情况下存储数据而没有在更新之间清除 - 可能很难使用Phonegap并非不可能。

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.


不再需要存储任何不需要支持的文件
up(或不能通过新政策)但不应随意删除。

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.

这篇关于应用商店更新后的本地存储清算?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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