• 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
Re: Out of process download support
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out of process download support


  • Subject: Re: Out of process download support
  • From: Scott Hancher <email@hidden>
  • Date: Fri, 21 Feb 2014 11:05:57 -0800

Apologies, I should have made the fact that this was an iOS question more evident. I'm assuming I should have also made it more evident that this was a question on how to "acceptance test" this support. I realize that exit() crashes the app Period. Again, this is just meant to test this functionality, and it's claimed that the "download sessions that store the results in a file and continue transferring data even when your app is suspended, exits, or crashes."

https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html

Since I'm not aware of any other means to programmatically exit an app, I'm currently using exit().

Having been a Mac user/developer for many years, I can fully understand the emotion brought about by what appears to be a lack of concern by a developer over the user's best interests/experiences. But before suggesting that a developer is considering "snatch[ing] the state of the device out of the user's hands," may I suggest you re-read the question to ensure that you're clear on what the developer is doing?

In any event, my TEST app is now getting relaunched and "application:handleEventsForBackgroundURLSession:completionHandler:" is being called when the download concludes successfully after I kill the TEST app with exit().



On Fri, Feb 21, 2014 at 10:34 AM, Fritz Anderson <email@hidden> wrote:
It would be helpful to know whether your question is about OS X or iOS. Groveling for the app-delegate method gave me the answer, but we shouldn’t have to search.

On 20 Feb 2014, at 5:20 PM, Scott Hancher <email@hidden> wrote:

> However, if my app is quit, then I don't seem to get a call to application:handleEventsForBackgroundURLSession:completionHandler: within a relaunched instance of my app nor is the file I've requested to download actually downloaded. I'm quitting my app via exit(EXIT_SUCCESS), which I suspect isn't ideal, but there doesn't seem to be another mechanism for killing it. I have tried to manually swipe the application up to remove it from the list of running apps on double tapping home, but this doesn't work either.


I don’t know the details, but the fact that it’s called a “background operation” suggests that the operation depends on the application going (at least initially) into the background, not that it should crash itself. I think it’s reasonable for iOS to assume that an app entering the background (even if later evicted) is in a safe state to continue the task, but a crashed application has enough wrong with it that the processes it spawns should be killed, too.

And in iOS a call to exit() is a crash. Period. Always.

Why on earth do you think it’s so important to destroy the app process? There’s a reason there is no supported way to do it: The device is the user’s computer. Not yours. Applications go off-screen when the user says so. Not you. You are not permitted to snatch the state of the device out of the user’s hands. Because it isn’t your computer.

If you can’t proceed at all (and I bet you can in this case), put up an alert explaining the situation and advise the user to press the Home button. Don’t just abscond.

But I suspect your app is in a recoverable state when its download commences. Put up a dancing bear (progress/activity view or the like) until the task ends. This has the further advantage that you can offer a cancel button to put the user (gasp) in control.

        — F

--

Xcode 5 Start to Finish: On sale late March/early April. Actually pretty good.




 _______________________________________________
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: Out of process download support
      • From: Scott Hancher <email@hidden>
References: 
 >Out of process download support (From: Scott Hancher <email@hidden>)
 >Re: Out of process download support (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Out of process download support
  • Next by Date: Re: Out of process download support
  • Previous by thread: Re: Out of process download support
  • Next by thread: Re: Out of process download support
  • Index(es):
    • Date
    • Thread