Downloader
This plugin is designed to support downloading files using Android DownloadManager.
联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.
Ionic 下载文件Downloader插件的安装(Installation)
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
Ionic 下载文件Downloader插件支持的平台(Supported Platforms)
- Android
Ionic 下载文件Downloader插件的用法(Usage)
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));