when downloading from storage, I would like to set a smaller timeout, e.g. only 5 - 10 seconds, is this possible?
I'm downloadiung like this:
let storage = FIRStorage.storage()
let storageRef = storage.reference(forURL: "gs://...")
let fileRef = storageRef.child(myLink)
let downloadTask = fileRef.write(toFile: url) { url, error in
...
I would make a extension to the StorageDownloadTask class and add a function that sets a timer with the requested time that cancels the request if fired.
Something like this:
So you would write:
Firebase Storage
has a feature where you canpause()
,cancel()
, andresume()
read hereI would set a class property as
StorageUploadTask
then I would put the pause or cancel in aDispatchAsync Timer
using aDispatchWorkItem
:Unfortunately Firebase doesn't have this feature available for the
RealTimeDatabase