简体   繁体   English

管理Cordova / Phonegap应用程序卸载

[英]Managing Cordova/Phonegap app uninstall

My Cordova app does create some files in the persistent filesystem, and I would like to clean them when the user uninstall the app. 我的Cordova应用程序确实在持久文件系统中创建了一些文件,当用户卸载应用程序时,我想清理它们。

On iOS, as persistent files are stored in the app folder, they will be remove by default, but on Android, they are stored at the device file system root, and they are not removed at uninstall. 在iOS上,由于永久文件存储在app文件夹中,因此默认情况下会将其删除,但在Android上,它们将存储在设备文件系统根目录下,并且在卸载时不会删除。

Is there any Cordova plugin able to run a script when an app is uninstalled ? 卸载应用程序后,是否有任何Cordova插件能够运行脚本?

If you create those files in SdCard and all you cannot remove them. 如果您在SdCard中创建了这些文件,那么您将无法删除它们。 But If you create them in AppCache, they will be removed. 但是,如果您在AppCache中创建它们,它们将被删除。 You cannot manually do some task before uninstalling. 在卸载之前,您无法手动执行某些任务。 OS did not give permission to do that. 操作系统未允许这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM