I am trying to upload multiple videos through NSURLSession in my App. But taskIdentifier for every request is coming same. Its not getting change for every request. How can we keep track for our request? How can we know which one gets complete?
This is my Code:
_uploadTask = [_session uploadTaskWithRequest:request fromData:body completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
id jsonResponse= [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
}];
[_uploadTask resume];
NSLog(@" task ID %ld",_uploadTask.taskIdentifier);
Here: _uploadTask is instance of NSURLSessionUploadTask, _session is an instance of NSURLSession, request is NSMutableURLRequest instance and body is NSData. OutPut is:
"task ID 1"
I would do the following to keep track