Reputation: 41
I have an Ionic 4 App that use IonicStorage with IndexDb . 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 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. I can't erase it
...
<application android:allowBackup="false" />
<application android:fullBackupContent="false" />
...
Can you suggest me something. Ty
Upvotes: 0
Views: 615
Reputation: 41
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. 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).
The file is also private. The problem that also remains, so how can I delete the log file from Ionic?
Upvotes: 1
Reputation: 41
Yes, this is working just on the app storage (saw it through chrome inspector). The user data are not cleared.
Upvotes: 0
Reputation: 791
Try this.ionicStorage.remove('yourStorageKey')
for each of your storage keys to remove all data in IndexedDB or sqlLite.
Upvotes: 0