1.0.1 • Published 9 years ago
cordova-plugin-buildsettings v1.0.1
Cordova BuildSettings Plugin
A plugin that gives your javascript access to build settings stored in XCode's Info.plist file
Using
Clone the plugin
$ git clone https://github.com/pardeike/cordova-plugin-buildsettings.gitCreate a new Cordova Project
$ cordova create buildsettings net.pardeike.buildsettings BuildSettingsInstall the plugin
$ cd buildsettings
$ cordova plugin add ../cordova-plugin-buildsettingsEdit www/js/index.js and add the following code inside onDeviceReady
buildsettings.get({
'somekey': 'default value'
}, function(defaults) {
var val = defaults['somekey'];
console.log(val);
});Install iOS platform
cordova platform add iosRun the code
cordova runAdd a key/value pair
Go to the main Info.plist file in XCode and add a key "somekey" with value "xcode value"Verify that when you run your project without cordova it show an alert for "default value" and when you run it from XCode it says "xcode value" instead.
More Info
For more information on setting up Cordova see the documentation
For more info on plugins see the Plugin Development Guide