简体   繁体   English

如何通过 Ionic 从我的应用程序中删除用户数据?

[英]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.

相关问题 如何从 ionic 5 应用程序的用户授权列表中删除相机权限? - how to remove camera permission from user authorisations list in ionic 5 app? 如何通过我的应用免费将用户数据存储在云中? - How to store user data in cloud for free from my app? 将数据从混合Ionic 2 App传递到inAppBrowser - Passing data from my hybrid Ionic 2 App to the inAppBrowser 如何从我的设备中查看离子应用程序中的错误 - How to see errors from an ionic app from my device 如何通过设置菜单防止用户禁用我的设备管理应用程序? - How to prevent a user from disabling my device admin app, through the settings menu? 我如何通知我的Android应用程序该用户将其从Facebook删除? - How can i notify my android app That user remove it from facebook? 从Ionic应用程序中删除控制台日志(发布) - Remove console logs from ionic app (release) 能否将我的离子应用程序中的用户应用程序评级发布到Play商店/ App Store,而无需将用户重定向到Play商店? - can we publish user app rating from my ionic app to Play Store/App Store without redirecting user to Play Store? 如何检测用户是否清除了我的应用数据 - How to detect if user cleared my app data 更新ionic 2应用程序而不会丢失用户数据? - Update ionic 2 app without loss of user data?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM