PackageDownloadCallback
public protocol PackageDownloadCallback
This protocol is used when downloading an update using BarracksClient.downloadPackage(response:, callback:, destination:)
-
This method is called during the download, to inform of the progress of the download.
Declaration
Swift
func onProgress(_ response:UpdateCheckResponse, progress:UInt)
Parameters
response
The
UpdateCheckResponse
used to trigger the download.progress
The download progress in percent.
-
This method is called when an error occurs during the download.
Declaration
Swift
func onError(_ response:UpdateCheckResponse, error: Error?)
Parameters
response
The
UpdateCheckResponse
used to trigger the download.error
The error raised during the download.
-
This method is used when an download is successfully completed.
Declaration
Swift
func onSuccess(_ response:UpdateCheckResponse, path:String)
Parameters
response
The
UpdateCheckResponse
used to trigger the download.path
The path of the downloaded file.