www/securestorage.js
function (success, error, nativeMethodName, args) {
    var fail;
    // args checking
    _checkCallbacks(success, error);

    // By convention a failure callback should always receive an instance
    // of a JavaScript Error object.
    fail = function(err) {
        // provide default message if no details passed to callback
        if (typeof err === 'undefined') {
            error(new Error('Error occured while executing native method.'));
        } else {
            // wrap string to Error instance if necessary
            error(_isString(err) ? new Error(err) : err);
        }
    };

    cordova.exec(success, fail, 'SecureStorage', nativeMethodName, args);
}
function (success, error, nativeMethodName, args) {
    var fail;
    // args checking
    _checkCallbacks(success, error);

    // By convention a failure callback should always receive an instance
    // of a JavaScript Error object.
    fail = function(err) {
        // provide default message if no details passed to callback
        if (typeof err === 'undefined') {
            error(new Error('Error occured while executing native method.'));
        } else {
            // wrap string to Error instance if necessary
            error(_isString(err) ? new Error(err) : err);
        }
    };

    cordova.exec(success, fail, 'SecureStorage', nativeMethodName, args);
}
function ( success , error , nativeMethodName , args ) { var fail ; // args checking _checkCallbacks ( success , error ) ; // By convention a failure callback should always receive an instance // of a JavaScript Error object. fail = function ( err ) { // provide default message if no details passed to callback if ( typeof err === 'undefined' ) { error ( new Error ( 'Error occured while executing native method.' ) ) ; } else { // wrap string to Error instance if necessary error ( _isString ( err ) ? new Error ( err ) : err ) ; } } ; cordova . exec ( success , fail , 'SecureStorage' , nativeMethodName , args ) ; }
Helper method to execute Cordova native method

@param   {String}    nativeMethodName Method to execute.
@param   {Array}     args             Execution arguments.
@param   {Function}  success          Called when returning successful result from an action.
@param   {Function}  error            Called when returning error result from an action.
Helper method to execute Cordova native method