How to use the cordova-common.PluginManager.get function in cordova-common

To help you get started, we’ve selected a few cordova-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Adobe-Marketing-Cloud-Apps / app-sample-android-phonegap / platforms / android / cordova / Api.js View on Github external
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
    var project = AndroidProject.getProjectFile(this.root);

    if(uninstallOptions && uninstallOptions.usePlatformWww === true && this.android_studio === true) {
      uninstallOptions.usePlatformWww = false;
      uninstallOptions.android_studio = true;
    }

    return PluginManager.get(this.platform, this.locations, project)
        .removePlugin(plugin, uninstallOptions)
        .then(function () {
            if (plugin.getFrameworks(this.platform).length === 0) return;

            selfEvents.emit('verbose', 'Updating build files since android plugin contained ');
            require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
        }.bind(this))
        // CB-11022 Return truthy value to prevent running prepare after
        .thenResolve(true);
};
github heyszu / szuschedule-app / platforms / android / cordova / Api.js View on Github external
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
    var project = AndroidProject.getProjectFile(this.root);

    if(uninstallOptions && uninstallOptions.usePlatformWww === true && this.android_studio === true) {
      uninstallOptions.usePlatformWww = false;
      uninstallOptions.android_studio = true;
    }

    return PluginManager.get(this.platform, this.locations, project)
        .removePlugin(plugin, uninstallOptions)
        .then(function () {
            if (plugin.getFrameworks(this.platform).length === 0) return;

            selfEvents.emit('verbose', 'Updating build files since android plugin contained ');
            require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
        }.bind(this))
        // CB-11022 Return truthy value to prevent running prepare after
        .thenResolve(true);
};
github katzer / cordova-plugin-badge / platforms / android / cordova / Api.js View on Github external
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
    var project = AndroidProject.getProjectFile(this.root);

    if (uninstallOptions && uninstallOptions.usePlatformWww === true && this.android_studio === true) {
        uninstallOptions.usePlatformWww = false;
        uninstallOptions.android_studio = true;
    }

    return PluginManager.get(this.platform, this.locations, project)
        .removePlugin(plugin, uninstallOptions)
        .then(function () {
            if (plugin.getFrameworks(this.platform).length === 0) return;

            selfEvents.emit('verbose', 'Updating build files since android plugin contained ');
            require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles();
        }.bind(this))
        // CB-11022 Return truthy value to prevent running prepare after
        .thenResolve(true);
};
github katzer / cordova-plugin-badge / platforms / ios / cordova / Api.js View on Github external
Api.prototype.addPlugin = function (plugin, installOptions) {

    var xcodeproj = projectFile.parse(this.locations);
    var self = this;

    installOptions = installOptions || {};
    installOptions.variables = installOptions.variables || {};
    // Add PACKAGE_NAME variable into vars
    if (!installOptions.variables.PACKAGE_NAME) {
        installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName();
    }

    return PluginManager.get(self.platform, self.locations, xcodeproj)
        .addPlugin(plugin, installOptions)
        .then(function () {
            if (plugin != null) {
                var headerTags = plugin.getHeaderFiles(self.platform);
                var bridgingHeaders = headerTags.filter(function (obj) {
                    return (obj.type === 'BridgingHeader');
                });
                if (bridgingHeaders.length > 0) {
                    var project_dir = self.locations.root;
                    var project_name = self.locations.xcodeCordovaProj.split('/').pop();
                    var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
                    var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
                    events.emit('verbose', 'Adding Bridging-Headers since the plugin contained  with type="BridgingHeader"');
                    bridgingHeaders.forEach(function (obj) {
                        var bridgingHeaderPath = path.basename(obj.src);
                        bridgingHeaderFile.addHeader(plugin.id, bridgingHeaderPath);
github intel-iot-devkit / android-things-samples / Zombie / ZombieDetector / platforms / android / cordova / Api.js View on Github external
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
    var project = AndroidProject.getProjectFile(this.root);

    if(uninstallOptions && uninstallOptions.usePlatformWww === true && this.android_studio === true) {
      uninstallOptions.usePlatformWww = false;
      uninstallOptions.android_studio = true;
    }

    return PluginManager.get(this.platform, this.locations, project)
        .removePlugin(plugin, uninstallOptions)
        .then(function () {
            if (plugin.getFrameworks(this.platform).length === 0) return;

            selfEvents.emit('verbose', 'Updating build files since android plugin contained ');
            require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
        }.bind(this))
        // CB-11022 Return truthy value to prevent running prepare after
        .thenResolve(true);
};
github QuickBlox / quickblox-javascript-sdk / samples / cordova / video_chat / platforms / android / cordova / Api.js View on Github external
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
    var project = AndroidProject.getProjectFile(this.root);

    if(uninstallOptions && uninstallOptions.usePlatformWww === true && this.android_studio === true) {
      uninstallOptions.usePlatformWww = false;
      uninstallOptions.android_studio = true;
    }

    return PluginManager.get(this.platform, this.locations, project)
        .removePlugin(plugin, uninstallOptions)
        .then(function () {
            if (plugin.getFrameworks(this.platform).length === 0) return;

            selfEvents.emit('verbose', 'Updating build files since android plugin contained ');
            require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
        }.bind(this))
        // CB-11022 Return truthy value to prevent running prepare after
        .thenResolve(true);
};
github katzer / cordova-plugin-badge / platforms / ios / cordova / Api.js View on Github external
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
    var xcodeproj = projectFile.parse(this.locations);
    var self = this;

    return PluginManager.get(self.platform, self.locations, xcodeproj)
        .removePlugin(plugin, uninstallOptions)
        .then(function () {
            if (plugin != null) {
                var headerTags = plugin.getHeaderFiles(self.platform);
                var bridgingHeaders = headerTags.filter(function (obj) {
                    return (obj.type === 'BridgingHeader');
                });
                if (bridgingHeaders.length > 0) {
                    var project_dir = self.locations.root;
                    var project_name = self.locations.xcodeCordovaProj.split('/').pop();
                    var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
                    var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
                    events.emit('verbose', 'Removing Bridging-Headers since the plugin contained  with type="BridgingHeader"');
                    bridgingHeaders.forEach(function (obj) {
                        var bridgingHeaderPath = path.basename(obj.src);
                        bridgingHeaderFile.removeHeader(plugin.id, bridgingHeaderPath);
github maishumaishu / ChiTuStore2 / user / platforms / android / cordova / Api.js View on Github external
.then(function () {
            return PluginManager.get(self.platform, self.locations, project)
                .addPlugin(plugin, installOptions);
        })
      .then(function () {
github intel-iot-devkit / android-things-samples / Zombie / ZombieDetector / platforms / android / cordova / Api.js View on Github external
.then(function () {
            return PluginManager.get(self.platform, self.locations, project)
                .addPlugin(plugin, installOptions);
        })
      .then(function () {
github apache / cordova-android / bin / templates / cordova / Api.js View on Github external
return Q().then(function () {
        return PluginManager.get(self.platform, self.locations, project).addPlugin(plugin, installOptions);
    }).then(function () {
        if (plugin.getFrameworks(this.platform).length === 0) return;