3 Replies Latest reply on Mar 2, 2017 3:06 AM by Mr. Opus

    Can't enable plugin

    Mr. Opus

      I want to add cordova-open plugin.

      As described I installed it with

      $ cordova plugin add cordova-open

      But then my cordova.plugins object contains only barcodeScanner.

      How to enable cordova-open plugin?

        • 1. Re: Can't enable plugin
          kerrishotts Adobe Community Professional

          Are you waiting for "deviceready" before checking "cordova.plugins"?

           

          Can you see the plugin installed when you run "cordova plugins ls"?

          • 2. Re: Can't enable plugin
            Mr. Opus Level 1

            > Are you waiting for "deviceready" before checking "cordova.plugins"?

            Here's my code:

            var app = {

                initialize: function () {

                    document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);

                },

             

                onDeviceReady: function () {

                    console.log(cordova.plugins);

                }

            };

             

            app.initialize();

             

            > Can you see the plugin installed when you run "cordova plugins ls"?

            Yes, it's installed. This command outputs:

            cordova-open 1.0.12 "Open"

            cordova-plugin-compat 1.1.0 "Compat"

            cordova-plugin-file 4.3.1 "File"

            cordova-plugin-file-transfer 1.6.1 "File Transfer"

            cordova-plugin-whitelist 1.3.1 "Whitelist"

            • 3. Re: Can't enable plugin
              Mr. Opus Level 1

              document.plugins always contains only barcodeScanner except when I launch app in browser. Can't add plugins on iOS or Android. Tried it on Linux and OS X systems. All the same. Tried to create empty project or from template. Anyway doesn't matter.