views:

1918

answers:

3

I'm writing an app with an image upload feature. Right now I'm using NSURL POST like: 125306.

When the app is closed as far as I can tell all of the uploads abort and the threads die. Is there

1) a way to make these upload threads persist when the app is no longer in the foreground?

2) an iPhone OS service that will accept requests to queue a job and run it in a mode managed by the OS?

+8  A: 

You aren't allowed to run in the background on an iPhone (as per Apple's Guidelines). Your app will be rejected from the AppStore if you do.

Lou Franco
To sound more correct, its not that we are not allowed to (as in but we can if we want) but we simply cant even if we want. It is just not possible to develop an app for iPhone which would run in background.
Chintan Patel
I'm not sure that's true. Email and Safari seem to do things in the background (email definitely continues to download my messages). There are probably non-public API's to do it. However, if you call them, you will be rejected.
Lou Franco
+3  A: 

As has been failry well documented, no background processes are allowed using the SDK.

August
+1  A: 

As noted, you cannot have a background process - a good compromise would be to resize the photo down to a size that could be transferred in a reasonable amount of time (user configurable would be best), and display an activity indicator of some kind so the user would know the upload was in progress.

An even better solution would be the resize, along with a progress indicator giving the percentage currently uploaded - but that involves some custom low-level HTTP code.

Kendall Helmstetter Gelner