aiber-martin/plugins/cordova-plugin-app-launcher/www/Launcher.js
Martin Donnelly a4b8625d0f init
2020-12-17 16:23:12 +00:00

30 lines
1.0 KiB
JavaScript

"use strict";
function Launcher() {}
Launcher.prototype.FLAG_ACTIVITY_NEW_TASK = 0x10000000;
Launcher.prototype.canLaunch = function (options, successCallback, errorCallback) {
options = options || {};
options.successCallback = options.successCallback || successCallback;
options.errorCallback = options.errorCallback || errorCallback;
cordova.exec(options.successCallback || null, options.errorCallback || null, "Launcher", "canLaunch", [options]);
};
Launcher.prototype.launch = function(options, successCallback, errorCallback) {
options = options || {};
options.successCallback = options.successCallback || successCallback;
options.errorCallback = options.errorCallback || errorCallback;
cordova.exec(options.successCallback || null, options.errorCallback || null, "Launcher", "launch", [options]);
};
Launcher.install = function () {
if (!window.plugins) {
window.plugins = {};
}
window.plugins.launcher = new Launcher();
return window.plugins.launcher;
};
cordova.addConstructor(Launcher.install);