0.8.0 • Published 7 years ago

cordova-plugin-memory-alert v0.8.0

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
7 years ago

cordova-plugin-memory-alert

Cordova plugin designed to dispatch native memory events to javascript. Current version is only propagating iOS memory warnings.

Basic usage

window.addEventListener('cordova-plugin-memory-alert.memoryWarning',
  function () {
    console.log('received a memory warning');
  }
);

cordova.plugins.CordovaPluginMemoryAlert.activate(true);

API

CordovaPluginMemoryAlert.activate

Activate or disable event propagation (turned off by default).

cordova.plugins.CordovaPluginMemoryAlert.activate(value);
  • value: boolean, true to activate, false to disable.

CordovaPluginMemoryAlert.setEventName

Set the name of the event emitted on window when a memory warning is received. Default value is cordova-plugin-memory-alert.memoryWarning

cordova.plugins.CordovaPluginMemoryAlert.setEventName(eventName);
  • eventName: string
Quick example
cordova.plugins.CordovaPluginMemoryAlert.setEventName('memWarning');
window.addEventListener('memWarning', function () { console.log('received a memory warning'); });
cordova.plugins.CordovaPluginMemoryAlert.activate(true);