LocalStorage在iOS上不持久

LocalStorage在iOS上不持久

本文介绍了关闭电源后,HTML5 LocalStorage在iOS上不持久的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要离线数据库存储的iPad(3G)网络应用程序。

I'm developing a web app for iPad (3G) that requires offline database storage.

起初我尝试使用HTML5的LocalStorage API。在测试时,我了解到如果我离开页面并关闭设备(iPad和iPhone),当我稍后重新打开页面时,我的数据无法通过LocalStorage访问(数据库似乎丢失了)。

At first I tried using HTML5's LocalStorage API. When testing, I learned that if I navigate away from the page and power off the device (both iPad and iPhone), when I reopen the page later, my data cannot be accessed via LocalStorage (database appears to be missing).

我在,但Android设备(Droid X和Galaxy)和运行WinXP + Safari的PC会在重启时保持我的数据。

I see this behavior at http://diveintohtml5.ep.io/examples/localstorage-halma.html with iOS devices, but Android devices (Droid X and Galaxy) and a PC running WinXP + Safari maintain my data across a restart.

我使用Webkit自己的客户端数据库存储在iOS设备上获得了适当的行为,就像这里可以看到的那样:。

I get appropriate behavior on the iOS devices using Webkit's own "client-side database storage", like what can be seen here: http://blog.darkcrimson.com/2010/05/local-databases/.

有没有人在LocalStorage中看到过这个问题?
有谁知道为什么数据库不会在iOS设备上维护?
有没有人有解决方案?

Has anyone seen this problem with LocalStorage?Does anyone know why the database wouldn't be maintained on iOS devices?Does anyone have a solution?

推荐答案

问题似乎与iOS版本有关。
我在iPad上使用v4.3时出现此问题,在iPhone上使用v4.3.1。 iPad上的
v4.2.1工作得很好。 iPad上的
v4.3.2将在断电时保持数据,但不用于清除缓存。
我希望这有助于其他人。

The problem seems to be with the version of iOS.I had this issues with v4.3 on an iPad, and v4.3.1 on an iPhone.v4.2.1 on an iPad works just fine.v4.3.2 on an iPad will maintain the data across power-off, but NOT for clearing the cache.I hope this helps someone else.

这篇关于关闭电源后,HTML5 LocalStorage在iOS上不持久的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 17:28
查看更多