• 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
Associating context with background NSURLSession tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Associating context with background NSURLSession tasks


  • Subject: Associating context with background NSURLSession tasks
  • From: Rick Mann <email@hidden>
  • Date: Mon, 09 Feb 2015 17:37:03 -0800

It seems that the NSURLSession API is missing a very important piece: a mechanism for associating context with a background task.

With my NSURLConnection-based code, I essentially created a generic delegate for each connection, which was responsible for invoking blocks for the various connection events. The blocks then captured the necessary context.

But with a background session, my app may be re-launched and have no in-memory context, so I need to resurrect that context from the NSURLSession and tasks API. I can't set the identifier of tasks (as far as I can tell), but I suppose I could use the provided task identifier, if it's guaranteed to be unique even after a task is complete.

Here's the thing. I'll have to persist that identifier along with enough information to reconstruct my context. If NSURLSession re-uses those identifiers, then I won't be able to reliably reconstruct the correct context.

Suggestions? Thanks,

--
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: Associating context with background NSURLSession tasks
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
    • Re: Associating context with background NSURLSession tasks
      • From: Rick Mann <email@hidden>
  • Prev by Date: NSURLSession and cellular access
  • Next by Date: Re: Associating context with background NSURLSession tasks
  • Previous by thread: Re: NSURLSession and cellular access
  • Next by thread: Re: Associating context with background NSURLSession tasks
  • Index(es):
    • Date
    • Thread