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.
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);
cordova plugin add https://github.com/alexportnoy/cordova-prefs-plugin
- iOS
- Android
v1.0.0:
- First version of plugin