cordova.define("cordova-plugin-syncData.cordova-plugin-syncData", function(require, exports, module) {

var exec = require('cordova/exec');

module.exports.coolMethod = function (arg0, success, error) {
    exec(success, error, 'cacheDataSync', 'coolMethod', [arg0]);
};



module.exports.start = function (arg0, success, error) {
    console.log('... cordova plugin sync data : start ....');
    SyncPlugin.subscribe({});
    exec(success, error, 'cacheDataSync', 'start_sync', [arg0]);
};


var SyncPlugin = {
    subscribe:function (arg0) {
     //  call to my plugin

    var instance =  window.sqlitePlugin.openDatabase({name: '_network_cache_storage',location: 'default'});

    exec(function (result) {
         instance.executeSql(result.query,"",function (res) { },function (err) {console.log('executeSql err -->',err);});
    }, 
    function (err) {
       console.log('error ... ',err);
    }, 'cacheDataSync', 'sqlite_listener', [arg0]);
    }
}
});
