IONIC 3 - Clear application data programmatically
我正在构建一个需要注销后清除缓存和本地存储数据的应用程序。
我的注销方法调用
1 2 3 4 5 6 7 8 9 10 | import { Storage } from '@ionic/storage'; @Injectable() export class CacheService { constructor(public cache: Storage) {} public clearCache(){ this.cache.clear(); localStorage.clear(); } } |
缓存和本地存储正在清除,但是当我转到>设置->应用程序->管理应用程序->我的应用程序时,它表明数据和缓存一直存储在Android应用程序数据中。
我可以手动执行:
Settings -> Applications -> Manage Applications -> My Application -> Clear data
如何像手动操作一样以编程方式清除应用程序数据?
随着应用大小的增加,我也遇到了类似的问题(文档