chemerisuk / cordova-plugin-app-settings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cordova-plugin-app-settings

NPM version NPM downloads Twitter

Donate Your help is appreciated. Create a PR, submit a bug or just grab me 🍺

Index

Supported Platforms

  • iOS
  • Android

Installation

$ cordova plugin add cordova-plugin-app-settings

Methods

Every method returns a promise that fulfills when a call was successful.

getString(key) : Promise

Get a string value for a key.

cordova.plugins.settings.getString("foo").then(function(value) {
    console.log("foo value is:", value);
});

setString(key, value) : Promise

Sets a string value for a key.

cordova.plugins.settings.setString("foo", "bar").then(function() {
    console.log("foo value is updated");
});

getNumber(key) : Promise

Get a numeric value for a key.

cordova.plugins.settings.getNumber("foo").then(function(value) {
    console.log("foo value is:", value);
});

setNumber(key, value) : Promise

Sets a numeric value for a key.

cordova.plugins.settings.setNumber("foo", 123).then(function() {
    console.log("foo value is updated");
});

getBoolean(key) : Promise

Get a boolean value for a key.

cordova.plugins.settings.getNumber("foo").then(function(value) {
    console.log("foo value is:", value);
});

setBoolean(key, value) : Promise

Sets a boolean value for a key.

cordova.plugins.settings.setNumber("foo", true).then(function() {
    console.log("foo value is updated");
});

About

License:MIT License


Languages

Language:Objective-C 45.3%Language:Java 43.9%Language:JavaScript 10.8%