Android Downloader Cordova plugin
Forked from integrator-cordova-plugin-downloader
This plugin is designed to support downloading files using Android DownloadManager.
Supported platforms
Installation
cordova plugin add @e-is/cordova-plugin-downloader
Usage
Create download request. For more info on parameter use refer to DownloadRequest
.
var request = {
uri: '',
title: '',
description: '',
mimeType: '',
visibleInDownloadsUi: true,
notificationVisibility: 0,
destinationInExternalFilesDir: {
dirType: '',
subPath: ''
},
destinationInExternalPublicDir: {
dirType: '',
subPath: ''
},
destinationUri: '',
headers: [{header: 'Authorization', value: 'Bearer iaksjfd89aklfdlkasdjf'}]
};
Starts download and returns location uri on completion
cordova.plugins.Downloader.download(request,
(location) => { alert('File is downloaded at ' + location) },
(err) => { alert(err)})
Credits and License
Based on Luka313's integrator-cordova-plugin-downloader
Based on Emil Bay's cordova-plugin-android-downloadmanager