iPhone localstorage lifecycle - does it survive an

2020-07-06 08:35发布

I'm currently developing an iPhone App that uses Phonegap and HTML5. I use localstorage to save in-game-achievements.

I was wondering what would happen the user pulls an update for that app from the AppStore. Is the localstorage data persistent? Or do I have to switch to SQLite, which is actually abandoned by the W3C..

Any experience would be appreciated.

2条回答
神经病院院长
2楼-- · 2020-07-06 09:09

If for localstorage you mean NSLibraryDirectory or NSDocumentDirectory your data should be available even after an upgrade.

查看更多
forever°为你锁心
3楼-- · 2020-07-06 09:15

Yes your localStorage is going to stick around until the app is deleted.

Try it out by building a basic app that you set some localStorage items, then recompile and update the app with changes your localStorage will stay where it is.

SQLLite will work, but you can store quite a bit of information in localStorage and achieve nearly the same results.

I use localStorage in a number of projects and it works great!

Hope that answers your question

查看更多
登录 后发表回答