hi,I have some question when i use background session to upload
if i upload a big file with backgroundConfiguration and make the app into background ,the example1 delegate method will be called back like this
example1
applicationDidEnterBackground
bytesSent: 32768, totoalBytesSent 11960320 ,totalBytesExpectedToSend: 52428800
bytesSent: 32768, totoalBytesSent 11993088 ,totalBytesExpectedToSend: 52428800
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3335 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:
everything is ok
example2:
but when i use multitasking upload,i will add them to an operationArray and i will take five tasks from the queue,when a task have completed and i will take a new task from operationArray to resume ,the delegate method will be called back linke this
applicationDidEnterBackground
bytesSent: 32768, totoalBytesSent 3211264 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 4947968 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3363 URLSession:task:didCompleteWithError:
request = 3361 URLSession:task:didCompleteWithError:
request = 3365 URLSession:task:didCompleteWithError:
[task][3367]take task[3367] from array
request = 3362 URLSession:task:didCompleteWithError:
request = 3366 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:
[task][3368]take task [3368] from array
[task][3369]take task[3369] from array
[task][3364]take task[3364] from array
[task][3370]take task[3370] from array
bytesSent: 32768, totoalBytesSent 32768 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 1638400 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3367 URLSession:task:didCompleteWithError:
request = 3368 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:
bytesSent: 32768, totoalBytesSent 32768 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 1802240 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3370 URLSession:task:didCompleteWithError:
request = 3369 URLSession:task:didCompleteWithError:
request = 3364 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:
the example2 is different from example1 is that example2 have progress calll back ,should it have progress call back when a task was completed in background?
there are alse have some strange logs , the URLSession:task:didCompleteWithError will called back after URLSessionDidFinishEventsForBackgroundURLSession: like this:
[task][3339]take task from array
applicationDidEnterBackground
bytesSent: 32768, totoalBytesSent 32768 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 1998848 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
URLSessionDidFinishEventsForBackgroundURLSession:
request = 3339 URLSession:task:didCompleteWithError: