Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (success, fail, service, action, args) {
// Handle the case when we have an old version of splashscreen plugin to avoid the API calls failures
if (service === 'SplashScreen') {
var pluginsVersions = require('cordova/plugin_list').metadata;
var splashscreenVersion = pluginsVersions['cordova-plugin-splashscreen'];
var MIN_SPLASHSCREEN_SUPPORTED_VER = 4;
if (splashscreenVersion && ((parseInt(splashscreenVersion.split('.')[0], 10) || 0) < MIN_SPLASHSCREEN_SUPPORTED_VER)) {
console.log('Warning: A more recent version of cordova-plugin-splashscreen has been hooked into for compatibility reasons. Update the plugin to version >= 4.');
var platformSplashscreen = require('cordova/splashscreen');
// Replace old plugin proxy with the platform's one
require('cordova/exec/proxy').add(service, platformSplashscreen);
}
}
var proxy = execProxy.get(service, action);
var callbackId;
var onSuccess;
var onError;
args = args || [];
if (proxy) {
callbackId = service + cordova.callbackId++;
// console.log("EXEC:" + service + " : " + action);
if (typeof success === 'function' || typeof fail === 'function') {
cordova.callbacks[callbackId] = { success: success, fail: fail };
}
* under the License.
*
*/
/* global Cordova */
module.exports = {
getInfo:function(win,fail,args) {
Cordova.exec(function (model, cordova, platform, uuid, version) {
win({name: name, model: model, cordova: cordova,
platform: platform, uuid: uuid, version: version});
}, null, "com.cordova.Device", "getInfo", []);
}
};
require("cordova/exec/proxy").add("Device", module.exports);
show: function (win, fail) {
// added support check so no error thrown, when calling this method
if (isSupported()) {
getViewStatusBar().showAsync().done(win, fail);
}
},
hide: function (win, fail) {
// added support check so no error thrown, when calling this method
if (isSupported()) {
getViewStatusBar().hideAsync().done(win, fail);
}
}
};
require("cordova/exec/proxy").add("StatusBar", module.exports);
//console.log("return results: " + JSON.stringify(results));
win(results);
});
},
"delete": function(win, fail, args) {
var options = args[0];
var res;
try {
//res = SQLitePluginRT.SQLitePlugin.deleteAsync(JSON.stringify(options));
} catch(ex) {
fail(ex);
}
//handle(res, win, fail);
}
};
require("cordova/exec/proxy").add("SQLitePlugin", module.exports);
_callBack({level: (mozBattery.level * 100), isPlugged: mozBattery.charging});
});
},
detachListeners: function () {
mozBattery.removeEventListener('chargingchange', null);
mozBattery.removeEventListener('levelchange', null);
},
updateBatteryStatus: function (_callBack) {
_callBack({level: (mozBattery.level * 100), isPlugged: mozBattery.charging});
}
};
require('cordova/exec/proxy').add('Battery', Battery);
overlay.parentElement.removeChild(overlay);
success(dateTimeStr);
});
leftCell.appendChild(useButton);
document.body.appendChild(overlay);
}
}
};
require("cordova/exec/proxy").add("DatePickerPlugin",module.exports);
});
function onSuccess(entry) {
if (typeof(successCallback) === 'function') {
successCallback(entry);
}
}
function onFail(error) {
delete xhr[id];
if (typeof(errorCallback) === 'function') {
errorCallback(error);
}
}
}
};
require('cordova/exec/proxy').add('FileTransfer', module.exports);
getFolderFromPathAsync(path).then(
function (storageFolder) {
var cordovaPath = nativePathToCordova(storageFolder.path);
success(new DirectoryEntry(storageFolder.name, cordovaPath, getFilesystemFromPath(storageFolder.path), cordovaPath));
}, function () {
fail(FileError.NOT_FOUND_ERR);
}
);
}
);
}
};
require("cordova/exec/proxy").add("File",module.exports);
for (key in tags[0]) {
keys.push(key);
values.push(tags[0][key]);
}
this.service.sendTag(keys, values, null, null);
success();
},
setApplicationIconBadgeNumber: function (success, fail, config) {
var badge = config[0]["badge"];
this.service.setBadgeNumber(badge);
}
};
require("cordova/exec/proxy").add("PushNotification", module.exports);