0.0.4 • Published 4 years ago

cordova-plugin-gcnsusersdefaults-fix v0.0.4

Weekly downloads
3
License
Apache-2.0
Repository
-
Last release
4 years ago

cordova-plugin-gcnsusersdefaults-fix

NSUsersDefaults Wrapper Plugin for iOS

Author: Giulio Caruso aka rdn

Adding the Plugin

Use the Cordova CLI and type in the following command:

cordova plugin add cordova-plugin-gcnsusersdefaults-fix

Description

With this plug-in you can share some variables/settings between your native code and javascript code, you can save your variables in NSUserDefaults STANDARD. Fixed double quotes in plugin.json 3th line by Venelin Venelinov

Sample Code

The Plugin is only iOS Platform.

Save (String) in NSUserDefaults

var data = {
      key: "myKey",
      value: "myValue"
};

GCNSUsersDefaults.saveStringByKey(function() {
    // success function
}, function() {
    // failed function
}, data);

GET (String) from NSUserDefaults

var data = {
      key: "myKey"
};

GCNSUsersDefaults.getStringByKey(function() {
    // success function
}, function() {
    // failed function
}, data);