In my app I’m using URL::downloadToFile() on iOS. The documentations states, that it is using a native OS background network task. Also the class created by the iOS implementation is called BackgroundDownloadTask.
In my naivety I was hoping, that this means, that JUCE and/or the OS handles the download in the background. But if I disconnect my iPad from the WiFi network, my app hangs indefinitely in
@fabian : Is this supposed to block. What is wrong here? The documentation, the implementation or my interpretation of it? If my interpretation is wrong, perhaps you can add a hint to the documentation URL::downloadToFile() to avoid repetition of the same fallacy? (like Michael here presumably)
Just add a button that, when clicked, will call task.reset() and the iOS App freezes.
The destructor of the class FallbackDownloadTask remains stuck in a while loop waiting that some sort of session deletes itself… something that ends up in swift code that I don’t understand.
Notice that there is an jassert (success); in the finished callback. When you cancel a download this assertion is caught by the debugger, but Xcode isn’t showing you the backtrace for the thread on which finished is called.
You can either remove the assertion or continue past the break in the debugger.