Skip to content

Cordova plugin to read and store iOS application preferences.

License

Notifications You must be signed in to change notification settings

Salcci/cordova-plugin-iospreferences

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Application Preferences plugin for Cordova iOS

Use this Cordova plugin to read and store iOS application preferences.

Getting started

Once you're familiar with that process, you may install this plugin with the Cordova CLI:

cordova plugin add https://github.com/hirtenfelder/cordova-plugin-iospreferences.git

Using the plugin

The plugin creates the object window.plugins.applicationPreferences with two methods get(key, success, fail) and set(key, value, success, fail). key is the name of the setting you want, value is the value of the setting you want to set.

success and fail are callback functions. Success is passed the settings value as a string. A full get example could be:

window.plugins.applicationPreferences.get('the_key', function(result) {
        alert("We got a setting: " + result);
    }, function(error) {
	    alert("Failed to retrieve a setting: " + error);
    }
);

A full set example could be:

window.plugins.applicationPreferences.set('the_key', 'the_value', function() {
        alert("It is saved");
    }, function(error) {
	    alert("Failed to retrieve a setting: " + error);
    }
);

NOTE: The preference must exist in a settings bundle and Root.plist in your project.

About

Cordova plugin to read and store iOS application preferences.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 68.4%
  • JavaScript 31.6%