Skip to content

This is a phonegap / cordova 3.3.0 plugin (iOS / Android) which allows to clear the cordova webview cache.

License

Notifications You must be signed in to change notification settings

moderna/cordova-plugin-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cache

This is a WebView cache plugin for Cordova 6.1.1+ supporting Android (>=4.1) and iOS(>=6.0). It allows to clear the cordova webview cache.

There is one method:

  • clear(successCallback, errorCallback)

Installation

You may use phonegap CLI as follows:

➜ phonegap local plugin add https://github.com/moderna/cordova-plugin-cache.git
[phonegap] adding the plugin: https://github.com/moderna/cordova-plugin-cache.git
[phonegap] successfully added the plugin

Usage

document.addEventListener('deviceready', onDeviceReady);
function onDeviceReady()
{
        var success = function(status) {
            alert('Message: ' + status);
        }

        var error = function(status) {
            alert('Error: ' + status);
        }

        window.cache.clear( success, error );
}

Android vs. iOS

On iOS, cache.clear deletes temporary files (images that have been downloaded by the app). However, on Android, cache.clear also deletes all local, persistent data (such as stored files and any data saved to localStorage).

About

This is a phonegap / cordova 3.3.0 plugin (iOS / Android) which allows to clear the cordova webview cache.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published