• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Restoring context with NSURLSession background tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Restoring context with NSURLSession background tasks


  • Subject: Restoring context with NSURLSession background tasks
  • From: Rick Mann <email@hidden>
  • Date: Fri, 21 Aug 2015 16:33:07 -0700

I'm finding the background task support to be lacking, in that there's a fair bit of context that's associated with my file downloads that I'm having to find a way to persist. I wonder if there's an easier way.

In my case, I'm writing an app that allows users to our 3D models offline. A model is comprised of thousands of small files. A request is made to get the catalog of files needed, and the response from that is a list of partial paths, and complete URLs for where to find each of the files.

The partial path tells me where the file needs to belong in the local hierarchy. Additional context includes where the local hierarchy is rooted (which is different for each model).

I need to get that context from the resulting delegate callback, and since I can get called after my app has died or been ejected, I have to be able to re-create that information from disk. Ideally, I could store a dictionary of serializable objects with the download task, and get that back from iOS in the callbacks. But what I'm doing is setting the taskDescription, and using that as a key into my own persisted data.

How do other people handle this?

TIA,

--
Rick Mann
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Restoring context with NSURLSession background tasks
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: Re: Moving vs copying file resulting from NSURLSession download task
  • Next by Date: Simulating NSURLSession background download tasks
  • Previous by thread: Mysterious SSL failures in iOS 9 simulator (but not on real devices)
  • Next by thread: Re: Restoring context with NSURLSession background tasks
  • Index(es):
    • Date
    • Thread