Uploading full gallery assets of iphone in background

Hi Apple Team,

I have to do some such functionality in my applications that when application is in background, I have to upload the entire gallery assets of the iphone to a server (if the user has given permission to upload). I have come to a point where my background processing is not running for more than 28-30 seconds. And my process is such that I pick up the asset one by one from the gallery and process it and put it in a single task for uploading to the background thread. All this happens in a loop and photos are uploaded one after the other untill 28-30 seconds(in background). As I have also got my app registered for background processing and also coding is running from all standard process according to apple documentation.

So I have to ask you something about background processing, my questions are as follows:

1: What is the maximum duration for background processing and background uploading? What if I want to increase the duration of background processing in my app?

2: Does Apple extend the background processing time for certain category of apps, if it does, then please mention those categories(Or share some links).

3: As my application is built for a particular organization(they upload their all photos), I need maximum background upload limit, is there any way Apple provides for that? if yes, could you please share sample code base or links.

4: Some applications like Google Photos etc. upload in the background for more than 30 seconds, is there a standard procedure that I can achieve as well?

5: If there is any framework provided by Apple to do this work then please mention it.

Thanks, I am waiting for your kind reply.

I'll start by addressing a few of these questions and we'll see where that get's us.

Regarding:

1: What is the maximum duration for background processing and background uploading? What if I want to increase the duration of background processing in my app?

The duration is not documented as it can vary based on device conditions, i.e., low data mode and low power mode. In general it is recommended to start a background URLSession, even if you are running in the foreground and then transition it to the background as stated in, TN 2277 Networking and Multitasking, under background tasks. This should give you time to complete your tasks. If your tasks are not completed, then you should do some book-keeping in your app to make sure the app knows which photos were uploaded and which ones the app needs to try again later when it returns the foreground.

Regarding:

3: As my application is built for a particular organization(they upload their all photos), I need maximum background upload limit

I would refere to my previous response and the following pinned Developer Forums post for Moving to Fewer, Larger Transfers.

Regarding:

5: If there is any framework provided by Apple to do this work then please mention it.

If you are using URLSession, you are using the right API.

Uploading full gallery assets of iphone in background
 
 
Q