disusered / cordova-open

Open audio, video, images and more with applications installed on the user's device
MIT License
54 stars 55 forks source link

not work in android #31

Closed sirius007 closed 9 years ago

sirius007 commented 9 years ago
      var open = cordova.plugins.bridge.open;
      function success() {
          console.log('Success');
      }

      function error(code) {
          if (code === 1) {
              console.log('No file handler found');
          } else {
              console.log('Undefined error');
          }
      }

      open('http://git-scm.com/images/logo@2x.png', success, error);
  };

242418 error ReferenceError: FileTransfer is not defined at downloadAndOpen (http://192.168.0.128:8100/plugins/com.bridge.open/www/bridge.open.js:41:16) at http://192.168.0.128:8100/plugins/com.bridge.open/www/bridge.open.js:25:5

disusered commented 9 years ago

The plugin depends on cordova-file-transfer for network requests. It should be installed automatically, if not then you'd have to add it: cordova plugin add cordova-plugin-file-transfer and it should work!

sirius007 commented 9 years ago

cordova plugin add cordova-plugin-file-transfer

disusered commented 9 years ago

Does it give the same error? Are you using Cordova, Phonegap, something else? Try the plugin with a local file first. If not look at the tests, there are examples there.