1

I have a simple task, yet I am still not sure of the best way to accomplish this. I have a json endpoint that defines a list of assets that my app relies upon that need to be preloaded. They are images, and audio files. Given the nature of my app, I prefer that these assets be fully downloaded prior to the user interacting with the app. I expect it could be up to about 50MB in total and I believe my best bet is to download to the local file system. I figure the first launch will load asset defined in the json file and then when needed the app will just pull from the local files.

First off, is this the best approach and if it is, how should I implement this. AFNetworking, NSOperation Queues, NSURLSessionDownloadTask ?

I am reading through a ton of documentation but I'm not sure what's outdated and what's currently considered the best approach to this problem. I'd love it if I could find a nice clean example of this process or if someone could point me to a relevant tutorial on the topic.

nwales
  • 3,521
  • 2
  • 25
  • 47
  • Best approach is to actually just ship the content within the App's bundle; a 50MB download the first time a user opens your app is a good scenario that they'll quit it and delete it right then. If the app is listed as a 50MB download on the App Store; the purchaser knows that and that is what you want! – klcjr89 Jul 26 '14 at 01:24
  • I agree that is probably true. The problem is that we need to be able to refresh content on a regular basis. – nwales Jul 26 '14 at 01:39
  • Which is quite common, I recommend shipping everything you need within the App bundle, and at first launch call a lightweight object (such as JSON or XML/Plist) through a http request and grab the changed/new files only. Do it in a way that doesn't interfere with the user using the App however and display a `UIProgressView` in the navigation bar or something. – klcjr89 Jul 26 '14 at 01:41
  • Unfortunately our client has been told that they will have complete ability to add and remove content from a CMS. So I'm stuck with that reality. – nwales Jul 26 '14 at 01:56
  • Thanks troop231. I followed your advice to include as much as I can in the main bundle and only update new/changed assets. – nwales Aug 02 '14 at 18:25

1 Answers1

1

I ended up using background transfer service based on this tutorial. It seems to perform just what I needed

http://www.appcoda.com/background-transfer-service-ios7/

nwales
  • 3,521
  • 2
  • 25
  • 47