I would like to ask a question when I was in the background with backgroundSessionConfigurationWithIdentifier
upload task encountered the following problem:
Background: I have a lot of uploading task (assuming that there are 200), I will create 200 jobs in a for loop, to join the queue, queue maximum number of concurrent is 4, I use backgroundSession
to upload, and I implements handleEventsForBackgroundURLSession
method in the APPDelegate
, and print some info (interceptApplication
called for URLSession
), then implements NSURLSession
URLSessionDidFinishEventsForBackgroundURLSession
agent method, and invokes the handleEventsForBackgroundURLSession
completionHandler
(and print the log URLSessionDidFinishEventsForBackgroundURLSession
).
Question:
- I found that the progress information will be print after program enter background (but I checked the information and said that there would be no progress callback during background upload, and only called
didCompleteWithError
method for each task after all background tasks were completed). - Because the task a lot, I am in
handleEventsForBackgroundURLSession
andURLSessionDidFinishEventsForBackgroundURLSession
output information will be printed many times, I thought that all task can be completed, but I find the program will stop printing log message after Running for a period of time.
Any help is appreciated.