We are using Alamofire 4 and want to match URLSessionTask
s to entities in a database.
We first used the taskDescription
field of URLSessionTask
to put UUID of a database entity there, but then figured out that Alamofire creates a new task on request retry and this field is not copied over. taskIdentifier
also changes with every new task created, and there seem to be no way to track the change of taskIdentifier
in Alamofire.
Are there any other techniques to match tasks and entities in a database or files? The end goal is to delete file + entity if background upload request succeeds. And that might happen after the app has been terminated, thus we currently store information in a database.