Skip to content

@capgo/capacitor-downloader

Capacitor plugin for downloading files with background support. On Android since 8.5.0, an opt-in OkHttp engine writes app-private destinations (cache, files) with quiet notifications.

Capacitor plugin for downloading files with background support. Provides resumable downloads with progress tracking.

Set downloadCompletedNotificationText on download() to show a localized system notification when a file finishes and the user granted notification permission. See Getting Started for a full example.

  • download - Start a single download or a multi-file batch (files, since 8.7.0, up to 32 files).
  • pause - Pause an active download. Download can be resumed later from the same position.
  • resume - Resume a paused download. Continues from where it was paused.
  • stop - Stop and cancel a download permanently. Downloaded data will be deleted.
  • downloadCompletedNotificationText (optional on download) - Show a localized system notification when a download succeeds and notification permission is granted.
  • title and description (optional on download, Android DownloadManager since 8.6.0) - Customize progress notification title and description. Ignored on iOS, Web, and OkHttp Android downloads.
MethodDescription
downloadStart a new download task.
pausePause an active download. Download can be resumed later from the same position.
resumeResume a paused download. Continues from where it was paused.
stopStop and cancel a download permanently. Downloaded data will be deleted.
checkStatusCheck the current status of a download.
getFileInfoGet information about a downloaded file.
addListenerListen for download progress updates. Fired periodically as download progresses.
addListenerListen for download completion. Fired when a download finishes successfully.
addListenerListen for download failures. Fired when a download encounters an error.
removeAllListenersRemove all event listeners. Cleanup method to prevent memory leaks.
getPluginVersionGet the plugin version number.

This reference is synced from src/definitions.ts in capacitor-downloader.

Keep going from @capgo/capacitor-downloader

Section titled “Keep going from @capgo/capacitor-downloader”

If you are using @capgo/capacitor-downloader to plan storage and file handling, connect it with Using @capgo/capacitor-downloader for the native capability in Using @capgo/capacitor-downloader, @capgo/capacitor-data-storage-sqlite for the implementation detail in @capgo/capacitor-data-storage-sqlite, Using @capgo/capacitor-data-storage-sqlite for the native capability in Using @capgo/capacitor-data-storage-sqlite, @capgo/capacitor-file for the implementation detail in @capgo/capacitor-file, and Using @capgo/capacitor-file for the native capability in Using @capgo/capacitor-file.