Skip to main content

Downloader

This plugin is designed to support downloading files using Android DownloadManager.

https://github.com/Luka313/integrator-cordova-plugin-downloader.git

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation#

$ npm install integrator-cordova-plugin-downloader
$ npm install @ionic-native/downloader
$ ionic cap sync

Supported Platforms#

  • Android

Usage#

React#

Learn more about using Ionic Native components in React

Angular#

import { Downloader } from '@ionic-native/downloader/ngx';
constructor(private downloader: Downloader) { }
...
var request: DownloadRequest = {
uri: YOUR_URI,
title: 'MyDownload',
description: '',
mimeType: '',
visibleInDownloadsUi: true,
notificationVisibility: NotificationVisibility.VisibleNotifyCompleted,
destinationInExternalFilesDir: {
dirType: 'Downloads',
subPath: 'MyFile.apk'
}
};
this.downloader.download(request)
.then((location: string) => console.log('File downloaded at:'+location))
.catch((error: any) => console.error(error));