FileDownloadNotificationManager

Functions

Link copied to clipboard

Call this method to show the "download cancelled" notification. Takes as parameter the downloadId. Safe to call from any thread.

Link copied to clipboard
abstract fun showDownloadFailedNotification(downloadId: Long, url: String?)

Call this method to show the "download failed" notification. Takes as parameters the downloadId and the download url. Safe to call from any thread.

Link copied to clipboard
abstract fun showDownloadFinishedNotification(downloadId: Long, file: File, mimeType: String?)

Call this method to show the "download complete" notification. Takes as parameters the downloadId, the downloaded file and optionally the file mimeType Safe to call from any thread.

Link copied to clipboard
abstract fun showDownloadInProgressNotification(downloadId: Long, filename: String, progress: Int = 0)

Show an "in progress" notification for the file being downloaded. It can be called multiple times with the progress of the download, and receives the downloadId and the filename. Although it is safe to call this method from any thread, if called too frequently, it is recommended to call it on a background thread.