cordova-plugin-clear-data

Cordova plugin to clear locally persistent user data on Android and iOS.

Usage no npm install needed!

<script type="module">
  import cordovaPluginClearData from 'https://cdn.skypack.dev/cordova-plugin-clear-data';
</script>

README

cordova-plugin-clear-data Latest Stable Version Total Downloads

Cordova plugin to clear locally persistent user data on Android and iOS.

Installation

$ cordova plugin add cordova-plugin-clear-data

Usage

The plugin is exposed via the ClearData global namespace.

cache()

Platforms: Android and iOS

Clears the web resources cache of the application (in-memory and on-disk).

ClearData.cache(success, error);

Parameters

  • {function} success - (optional) function to execute on successfully clearing app cache.
  • {function} error - (optional) function to execute on failure to clear app cache. Will be passed a single argument which is the error message string.

Simple usage

ClearData.cache();

Advanced usage

ClearData.cache(function() {
    console.info('Successfully cleared app cache');
}, function(err) {
    console.error('Error clearing app cache', err);
});