UIWebView在哪里保存WebDB数据库?
我正在开发一个 iOS 应用程序,它使用 UIWebView,并且内部运行的 WebApp 使用 WebDB 来存储其本地数据。
我想“重置” my 的状态,其中包括:
- 删除任何缓存的项目(图像、html 等) - 已完成并且工作正常:-)
- 删除由 Web 应用程序创建的任何 WebDB。
任何人对如何做第 n 项有任何想法。 2?
I'm developing an iOS app which uses a UIWebView and the WebApp running inside uses WebDB to store it's local data.
I would like to 'reset' the state of the my which would include:
- Removing any cached items (images, html and etc) - This is done and is working fine :-)
- Remove any WebDB created by the Webapp.
Anyone has any ideias on how to do item n. 2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到的唯一答案是重新安装该应用程序。这绝对有效。在“设置”下清除 Safari 的缓存则不会。 Android 有办法做到这一点,但 iOS 却没有。
您知道 webdb 已被弃用,对吧?我不建议在其上构建新的应用程序。 IndexDB 是替代品,它在 UIWebView 中工作得很好。不过,清除它也会遇到同样的问题。
如果可以的话,实施应用程序端清除例程并自行完成。在开发过程中,我喜欢在某处实现一个“隐藏”的 5 像素点,在点击时执行此操作,然后在点击时重新加载视图。它使开发速度更快。如果不存在安全风险,您甚至可以在 Beta 阶段将其保留在那里,或者让服务器仅根据凭据将其呈现给用户。
The only answer I have ever found was re-installing the app. That definitely works. Clearing Safari's cache under Settings does not. There is a way to do this in Android, but not iOS.
You know webdb is deprecated, right? I wouldn't recommend building a new app on it. IndexDB is the replacement, and it works fine in a UIWebView. You'll have the same issues with clearing it, though.
If you can, implement an application-side clearing routine and do it yourself. During development, I like to implement a "hidden" 5-pixel spot somewhere that does this when tapped, then reloads the view when tapped. It makes development MUCH faster. You can even leave it there during the Beta phase if it's not a security risk, or have the server render it only to users based on credentials.