Skip to content

Plugin to set and obtain variables with sensitive data, such as API_KEY, API_RUL

License

Notifications You must be signed in to change notification settings

SistePar/cordova-plugin-privatevar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CORDOVA - PRIVATE VARIABLE PLUGIN

The plugin is simple, a function "get" in JavaScript is created and it returns data of type JSON.

INSTALL

To install from the Cordova CLI:

cordova plugin add cordova-plugin-privatevar

SET DATA IN ANDROID

In the Java file in app Project /src/java/com/sistepar/cordova/plugin/PrivatevarPlugin.java you can add all the data that you want to be returned in Json.

/* Edit here to return data in json */
json.put("apiUrl", "https://api.sistepar.com");
json.put("apiKey", "12345678");

SET DATA IN IOS

From the Xcode we enter the Plugins folder then PrivateVar.m and in the getDatasToReturn() method we modify the datas to return.

/* Edit here to return data in json */
return @{
         @"apiUrl": @"https://api.sistepar.com",
         @"apiKey": @"12345",
         };

USE PLUGIN

To use it from Cordova inside the deviceredy event.

/* Call the plugin */
cordova.plugins.privatevar.get(function(data){
  alert(JSON.stringify(data));
});

License: The MIT License

Made By sistepar.com

About

Plugin to set and obtain variables with sensitive data, such as API_KEY, API_RUL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published