I have an app that saves a bookmark of the readers position an put in into localStorage. When I close the App on iOS 5.1 the bookmark is gone, but on 5.0.1 it´s still there?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Unfortunately, in iOS5.1, localstorage is considered temporary data that can be deleted at any time... But Kerri Shotts wrote a code to support NATIVE persistence of localStorage with phoneGap : http://pastebin.com/5881768B
(it will copy the localstorage file to a secure folder and restore it if necessary)
And phonegap team is working on that : https://issues.apache.org/jira/browse/CB-330
回答2:
It's a widely published misconception that closing apps on the 'multitasking bar' actually closes the application. It does no such thing - the bar simply maintains a list of recent apps.
See this post for a more in-depth discussion.