1 Reply Latest reply on Mar 8, 2017 11:54 AM by ryanskihead

    Plugins Not Working

    52559weqasdawre3rasdas

      Hello,

       

      I am getting [object object] when using any plug-in except device plug-in.

       

      index.html

       

      <!DOCTYPE html>

      <html>

       

       

        <head>

            <script type="text/javascript" src="cordova.js"></script>

          </head>

       

          <body>

        <script>

        document.addEventListener("deviceready", onDeviceReady, false);

       

        function onDeviceReady() {

        alert(device.cordova);

        alert(navigator.camera);

       

       

       

        navigator.camera.cleanup(onSuccess, onFail);

       

       

        function onSuccess() {

        alert("Camera cleanup success.")

        }

       

       

        function onFail(message) {

        alert('Failed because: ' + message);

        }

        }

       

        </script>

       

        </body>

      </html>

       

      config.xml

       

      <?xml version="1.0" encoding="UTF-8" ?>

      <widget xmlns   = "http://www.w3.org/ns/widgets"

              xmlns:gap   = "http://phonegap.com/ns/1.0"

              id          = "org.humane.app"

              versionCode = "15"

              version     = "2.0.1" >

       

       

          <name>Fox Humane 11</name>

          <description>

              Octoberfest App.

          </description>

         

       

         

        <preference name="orientation" value="portrait" />

       

        <plugin name="cordova-plugin-camera" spec="2.4.0" />

        <plugin name="cordova-plugin-device" spec="1.1.5" />

        <plugin name="cordova-plugin-whitelist" spec="1.3.2" />

         

          <allow-navigation href="*" />

          <access origin="*" />

       

       

       

       

      </widget>

       

       

       

       

      alert(device.cordova);  - Outputs 6.1.2

      alert(navigator.camera); - Outputs [object object]

      alert('Failed because: ' + message); - Outputs Failed because: Invalid action

       

      Message was edited by: Quentin Salzwedel