Posts

Post not yet marked as solved
5 Replies
Hello Polyphonic, isenwald2020, we're currently dealing with a related problem. We're able to delete a partially downloaded stream if the download task is cancelled manually by calling task?.cancel() (exactly as described above). However, the task can also be cancelled automatically when the app is killed. We've tried to store the url from aggregateAssetDownloadTask:willDownloadTo in UserDefaults. But if we try to delete file at that url using FileManager after the app starts again, it throws an error saying No such file or directory and the partially downloaded stream is still visible in the iPhone Storage section. By after the app starts again I mean after assetDownloadUrlSession.getAllTasks returns the pending task and task:didCompleteWithError is called with an error. My question is can we delete partially dowloaded streams if the download task is cancelled automatically when the app is killed? Thanks in advance for any help.