Long-running upload task in the background

Dear community,

Our app allows users to upload up to 250 pictures and other files after submitting a form. Since this can take quite some time, we do not want to force users to keep the app open during the entire upload process. Instead, we would like to move it into a background task so that users can continue doing other things or even switch to another app.

Currently, we are using the file-transfer plugin to upload files one by one and display the upload count on a progress bar. I assume that moving this process to the background is somehow going to make use of the Background Tasks API. However, the docs state that the task supplied to beforeExit() “should finish in less than 3 minutes or your app risks being terminated by the OS”.

How should we deal with tasks that potentially exceed this limit? Can we schedule another background task once the current one has finished and upload only a few files per task? Can we observe termination of the task and send a notification to inform the user? I would much appreciate if someone could provide recommendations or share their experience.

Best regards,

Did you succeed to make it work ?