iOS swift Firebase storage downloading massive recordsdata background challenge

I am making an attempt to obtain massive video recordsdata from Firebase Storage, and whereas I have been looking out entire net I did not discover any good answer to my challenge, whereas I am continously improve Firebase variations.
So, I’ve added the “Background fetch” and “Background processing” capabilities to my undertaking, and added the “Permitted background activity scheduler identifiers” merchandise in data.plist file with “GTMSessionFetcher-firebasestorage.googleapis.com”, however after I’m downloading these recordsdata I bought the error:
Background Activity 61 (“GTMSessionFetcher-firebasestorage.googleapis.com”), was created over 30 seconds in the past. In purposes working within the background, this creates a danger of termination. Keep in mind to name UIApplication.endBackgroundTask(_:) to your activity in a well timed method to keep away from this.
Right here is my instance code:
for urlString in [ ... ] {
DispatchQueue.world(qos: .userInitiated).async {
let ref = self.storage.reference(forURL: urlString)
// Obtain to the native filesystem
ref.write(toFile: fileURL) { _, error in
if let error = error {
print(worth: error, sort: .error)
onDemand(.failure(error))
} else {
onDemand(.success(true))
}
}
}
}
I’ve tried to restrict the variety of threads downloading utilizing semaphore to restrict the variety of threads created, however with out no success.
Not settings QoS end in the identical errors.
These warnings stop me from publishing my app to the shop.
Have you ever any suggestion ?
Credit: www.ismmailgsm.com