Our users select photos and videos to upload to our backend system. Currently, we have to:
1. Write each PHAsset to disk
2. Schedule the background upload using NSURLSession
3. If they run out of disk space or close the app before we write it to disk, we have a bunch of alternate paths (batching uploads, local notifications to nudge them to reopen the app until the batch of files is ready to be uploaded)
To make this easier on ourselves, we first send metadata about the assets to our server so that the app can check the server for assets it should be uploading.
Would it be safe/possible to use the background fetch API to check our backend for pending uploads, and then return upload requests (instead of download requests)? Would we be able to write the assets to disk during the
application:performFetchWithCompletionHandler:
callback?