I have an iOS application, where I need to download over 60-70 videos a week of size 3-8MB each. The issue is, how do I download these videos? I am storing the list of videos and urls in a database.
Possible solutions:
Use a UIBackgroundTaskIdentifier
, call beginBackgroundTaskWithExpirationHandler
as soon as the app starts. This task will download one video.
In the endBackgroundTask
I will mark that particular video as downloaded.
Concerns here are, can I start multiple UIBackgroundTaskIdentifier
?
Where should I start them? In AppDelegate? A particular controller?
If I start it in a particular controller, on viewDidLoad()
what will happen if the app exits?
Please guide me or provide an alternate solution. Thanks