No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android
demo
ios/Plugin
src
.gitignore
.npmignore
CapacitorDownloader.podspec
README.md
package-lock.json
package.json
rollup.config.js
tsconfig.json

README.md

Capacitor Downloader

npm npm Build Status

Installation

  • npm i capacitor-downloader

Usage

import { Downloader } from 'capacitor-downloader';
const downloader = new Downloader();
const data = await downloadManager.createDownload({
  url:
    'https://wallpaperscraft.com/image/hulk_wolverine_x_men_marvel_comics_art_99032_3840x2400.jpg'
});
const imageDownloaderId = data.value;
downloader
  .start({id:imageDownloaderId}, (progressData: ProgressEventData) => {
    console.log(`Progress : ${progressData.value}%`);
    console.log(`Current Size : ${progressData.currentSize}%`);
    console.log(`Total Size : ${progressData.totalSize}%`);
    console.log(`Download Speed in bytes : ${progressData.speed}%`);
  })
  .then((completed: DownloadEventData) => {
    console.log(`Image : ${completed.path}`);
  })
  .catch(error => {
    console.log(error.message);
  });

Api

Method Default Type Description
createDownload(options: DownloadOptions) Promise<Options> Creates a download task it returns the id of the task
getStatus(options:Options) Promise<StatusCode> Gets the status of a download task.
start(options:Options, progress?: Function) Promise<DownloadEventData> Starts a download task.
resume(options:Options) Promise<void> Resumes a download task.
cancel(options:Options) Promise<void> Cancels a download task.
pause(options:Options) Promise<void> Pauses a download task.
getPath(options:Options) Promise<void> Return the path of a download task.

Example Image

IOS Android
Coming Soon Coming Soon

TODO

  • Local Notifications