Closed spatialbits closed 1 year ago
@spatialbits did you ever get any answer on this or to find a work around?
The background uploads do nor work and couldNotUploadFile
error is logged if app is backgrounded and then foregrounded during the upload.
@mabdullahsaeed @spatialbits I'm not familiar with Flutter per se, but the current state of background uploads is that it uses background tasks which will not allow you to resume an in-progress upload in the background. Instead an upload that was scheduled using a background task would be executed at some time in the future (the system decides when).
We're currently in the process of looking into a transition back to background URLSessions which actually work as you'd expect. Unfortunately this isn't a quick fix that we can apply so it will take a while longer for us to get on this. (I've only recently started as a maintainer on the project, so apologies for some of the long standing questions in the issues).
Once we have a fix I will update this issue
From https://github.com/tus/TUSKit/issues/128#issue-1214538206
@foxware00: I see we've got a new version using background support in iOS 13 and higher. However you cannot use background url sessions, something of a requirement if you're starting uploading in a share extension and then picking up where you left off in the main app.
Some of the old issues which were resolved, but have since been re-opened due to the recent 3.0.0 changes
https://github.com/tus/TUSKit/issues/57#issuecomment-610188074
Do you think we could move back to delegates rather than callbacks to allow for both background sessions and background tasks side by side?
@donnywals any progress on transitioning to background URLSessions?
I'm working on it but there are some pretty big differences between what we do now and how we need to handle background URLSession. Mainly due to the fact that we have to upload from files instead of from a stream of data.
TUSKit is something I work on part time so we're moving slowly but surely at this point.
Hi @abdulmomin703, @spatialbits and @mabdullahsaeed.
I currently have a working implementation of background uploads that I'm testing and would love for you three to take it for a spin. Instead of pointing to a release version of TUSKit
, can you use the dw/bg-urlsession
branch to see if everything works as expected for you?
Please make sure to check out the README since there are a few minor steps to implement before background uploads can work.
Cheers!
New background uploads are merged in https://github.com/tus/TUSKit/pull/161 and will be released soon! 🎉 Feel free to try it out.
I am a Flutter developer integrating TUSKit into our app and having difficulties getting background uploading to work.
So I am attempting to run the example app just to observe the background capability, but it looks like it only runs while the app is in the foreground.
Running the TUSKit Demo app using latest master. The log output below is the result of the following sequence:
couldNotUploadFile
error is logged.I'm really new to iOS native and Swift and so this could be the result of me just misunderstanding of the library. If that is the case, I would very much appreciate some guidance on applying background uploads with TUSKit.
For reference, I have been following this guide that describes some common pitfalls with developing background uploads.