mramonlopez / cordova-plugin-file-downloader

Phonegap plugin to download a list of files or a single file to the phone, check consistency and unzip if necessary (Android and ios)
MIT License
23 stars 19 forks source link

Can't figure out how to use this plugin in quasar ( cordova ) project. #13

Closed rachitpant closed 4 years ago

rachitpant commented 4 years ago

I had added the plugin to a quasar project by going to src-cordova folder and running cordova plugin addcordova-plugin-file-downloader. All the cordova plugins have worked with just that in my quasar project. But here , even after adding , within any vue component , I get downloader is not defined. I also noticed the adding this plugin doesn't update the config.xml.

setaman commented 4 years ago

@rachitpant any solutions here? have the same Problem

rachitpant commented 4 years ago

I ended up using cordova-plugin-file-transfer plugin. Served me well.

setaman commented 4 years ago

i ended up with own implementation, but here the possible solution that i have found out: i created downloader.js and added some test code:

document.addEventListener(
  "deviceready",
  () => {
    downloader.init({ folder: "folder" });
    downloader.get("url" );
  },
  false
);

const events = [
  "DOWNLOADER_downloadProgress",
  "DOWNLOADER_initialized",
  "DOWNLOADER_downloadSuccess",
  "DOWNLOADER_downloadError"
];

for (const event of events) {
  document.addEventListener(event, data => {
    console.log(event);
    console.log(data);
  });
}

now you can import this script in any Vue component and this works

WebScaffolder commented 1 year ago

i ended up with own implementation, but here the possible solution that i have found out: i created downloader.js and added some test code:

document.addEventListener(
  "deviceready",
  () => {
    downloader.init({ folder: "folder" });
    downloader.get("url" );
  },
  false
);

const events = [
  "DOWNLOADER_downloadProgress",
  "DOWNLOADER_initialized",
  "DOWNLOADER_downloadSuccess",
  "DOWNLOADER_downloadError"
];

for (const event of events) {
  document.addEventListener(event, data => {
    console.log(event);
    console.log(data);
  });
}

now you can import this script in any Vue component and this works

is cordova plugin supports Vue when build or did you use quaser.

setaman commented 1 year ago

@WebScaffolder after 3 years, i don't know what this issue is about. But yes, I should have been using Quasar