[英]How to remove User data from my app through Ionic?
I have an Ionic 4 App that use IonicStorage with IndexDb .我有一个使用 IonicStorage 和IndexDb的 Ionic 4 应用程序。 The user will take some photos that will be saved in the storage.
用户将拍摄一些将保存在存储中的照片。 After the process is done, if the user will take a look into app settings will see something like this:
该过程完成后,如果用户查看应用设置,将会看到如下内容:
Problem: When the user will attempt to perform another login the user data must be erased, cleared.问题:当用户尝试再次登录时,必须删除、清除用户数据。 I tried to delete the data by calling the clear method from the storage.
我试图通过从存储中调用 clear 方法来删除数据。
/**
* Clear the entire key value store. WARNING: HOT!
* @returns {Promise} Returns a promise that resolves when the store is cleared
*/
public ClearStorage(): Promise<any> {
return this.ionicStorage.clear();
}
Also I added these flags in the config.xml ...but without success.我还在 config.xml 中添加了这些标志......但没有成功。 I can't erase it
我无法抹去
...
<application android:allowBackup="false" />
<application android:fullBackupContent="false" />
...
Can you suggest me something.你能给我一些建议吗。 Ty
泰
I understand whats happens with the storage and with the user's data.我了解存储和用户数据会发生什么。 The problem is not the clear function, it's working perfectly fine.
问题不在于 clear 函数,它运行得非常好。 The problem is that the methods from the storage object are logged into a specific file.
问题是来自存储对象的方法被记录到一个特定的文件中。 Basically when I save a base-64 photo into a storage object it automatically add a new entry to the log file (eg: One base64 string image has around 500kb so the log file size will increase with 500kb).
基本上,当我将 base-64 照片保存到存储对象时,它会自动向日志文件添加一个新条目(例如:一个 base64 字符串图像大约有 500kb,因此日志文件大小将增加 500kb)。
The file is also private.该文件也是私有的。 The problem that also remains, so how can I delete the log file from Ionic?
问题仍然存在,那么如何从 Ionic 中删除日志文件?
为每个存储键尝试this.ionicStorage.remove('yourStorageKey')
以删除 IndexedDB 或 sqlLite 中的所有数据。
Yes, this is working just on the app storage (saw it through chrome inspector).是的,这仅适用于应用程序存储(通过 Chrome 检查器看到)。 The user data are not cleared.
不清除用户数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.