cpc

cordova-plugin-customconfigparameters

Cordova Custom Config Parameters Plugin

Showing:

Popularity

Downloads/wk

66

GitHub Stars

6

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

0

License

Apache-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Cordova Custom Config Parameters Plugin

Why?

When you use a web service which requires user name and password, mostly it is stored in your app JS code. But the javascript code is not encrypted and can easily be accessed by unzipping the APK. But if you try opening config.xml you will realise that this file is encrypted and cannot be read easily.

What?

This plugin allows you to store your sensitive data such as passwords, usernames etc. in config.xml. This is stored by creating custom parameters in config.xml. In the runtime, these parameters can be read from config.xml and used in javascript code. This really helps in creating next level of security for cordova based apps.

##Installation

Below are the methods for installing this plugin automatically using command line tools. For additional info, take a look at the Plugman Documentation, cordova plugin command and Cordova Plugin Specification.

Cordova

The plugin can be installed via the Cordova command line interface:

  • Navigate to the root folder for your phonegap or ionic project.
  • Run the command:
cordova plugin add cordova-plugin-customconfigparameters

or if you want to be running the development version,

cordova plugin add https://github.com/experiencecommerce/cordova-plugin-customconfigparameters.git

Usage?

Add Custom Parameters in Config.xml.

        <preference name="apiurl" value="https://github.com/experiencecommerce/cordova-plugin-customconfigparameters"/>
        <preference name="apiusername" value="demo"/>
        <preference name="apipassword" value="demo"/>

Get a key's value from the Config.xml.


   var paramkeyArray=["apiurl","apiusername","apipassword"];
    CustomConfigParameters.get(function(configData){
        console.log(configData);
        console.log(configData.apiurl);
        console.log(configData.apiusername);
        console.log(configData.apipassword);
    },function(err){
      console.log(err);
    },paramkeyArray);

Supported platforms

  • Android
  • iOS

NPM

https://www.npmjs.com/package/cordova-plugin-customconfigparameters

Credits

https://github.com/apache/cordova-labs/tree/cdvtest

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial