Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.08 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.08 KB

Cordova Preferences plugin v 1.0.0

This is a modified version to Alex Portnoy's version. Changes are:

  • Original plugin did not return JSON
  • Original version got stuck in a Mutex Wait on IOS when storing a NULL value

This plugin enables your app to store small pieces of data like app settings and preferences in device's persistent storage in a key-value manner. On iOS plugin uses NSUserDefaults, on Android - SharedPreferences features. All values are stored as a JSON strings on save and converted back to their respective types upon loading.

Usage

Plugin becomes available after DeviceReady event is fired.

To store a key-value pair call:

Preferences.put(myKey, myAwesomeValue);

Preferences.put(myKey, myAwesomeValue, success, fail);

To load a value for a key call:

Preferences.get(myKey, function(value) {}, error);

INSTALLATION

cordova plugin add https://github.com/alexportnoy/cordova-prefs-plugin

SUPPORTED PLATFORMS

  • iOS
  • Android

CHANGELOG

v1.0.0:

  • First version of plugin