Your help is appreciated. Create a PR, submit a bug or just grab me 🍺 |
---|
- iOS
- Android
$ cordova plugin add cordova-plugin-app-settings
Every method returns a promise that fulfills when a call was successful.
Get a string value for a key.
cordova.plugins.settings.getString("foo").then(function(value) {
console.log("foo value is:", value);
});
Sets a string value for a key.
cordova.plugins.settings.setString("foo", "bar").then(function() {
console.log("foo value is updated");
});
Get a numeric value for a key.
cordova.plugins.settings.getNumber("foo").then(function(value) {
console.log("foo value is:", value);
});
Sets a numeric value for a key.
cordova.plugins.settings.setNumber("foo", 123).then(function() {
console.log("foo value is updated");
});
Get a boolean value for a key.
cordova.plugins.settings.getNumber("foo").then(function(value) {
console.log("foo value is:", value);
});
Sets a boolean value for a key.
cordova.plugins.settings.setNumber("foo", true).then(function() {
console.log("foo value is updated");
});