Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

H2G2

macrumors newbie
Original poster
May 26, 2009
12
0
Hi,

my question is quite simple, but I am not sure the matching answer is that simple. Basicely, I would like my "backgrounded" * application to go back to foreground as soon as some processing (whose duration I can't forecast) is over.
Is there a way some of you know to do such (programmatically)?


Thanks in advance.


* About "backgrounded", It could be the official way (with the IOS4 multitasking feature) or with the "Backgrounder" tool (or equivalent) on a jailbreaked iPhone.
 
Using the official APIs certainly not. The user is in control, not you. I have no idea about Jailbroken devices or the "Backgrounder" tool. Perhaps they provide documentation you could consult?
 
Thanks for your answers Robbie.

Using the official APIs certainly not. The user is in control, not you
I had little hope about another answer.

I have no idea about Jailbroken devices or the "Backgrounder" tool. Perhaps they provide documentation you could consult?
Code source is provided here. But I can't use backgrounder yet*, thus it's quite difficult to "retro-engineer" it without knowledge of its behavior.

* (actually I don't plan jailbreaking my iPhone unless I am sure this will allow me to do this).
 
The accepted way of doing this is to send a local notification when the background task has completed - this will display an alert to the user and they can decide whether or not to return to the app (the alert will have a button to do this).
 
I read about this possibility, but unfortunately, I really want the application to switch on itself.

Thanks anyway for you answer Luke.
 
I read about this possibility, but unfortunately, I really want the application to switch on itself.

It's worth thinking about the user-experience of such behaviour: does your App really need to come to foreground whilst the user is potentially in the middle of typing (email, SMS, etc.), playing (game, music), talking (phone, VoIP, FaceTime, etc.) and so on...?

The accepted way of doing this is to send a local notification when the background task has completed - this will display an alert to the user and they can decide whether or not to return to the app (the alert will have a button to do this).

+1
 
It's worth thinking about the user-experience of such behaviour: does your App really need to come to foreground whilst the user is potentially in the middle of typing (email, SMS, etc.), playing (game, music), talking (phone, VoIP, FaceTime, etc.) and so on...?

In most apps : the answer is indeed "no".
In my case, the answer is "yes". Although I can't fully develop the idea, let's just say that is the normal behavior.
 
In most apps : the answer is indeed "no".
In my case, the answer is "yes". Although I can't fully develop the idea, let's just say that is the normal behavior.

If that's really the normal behavior, then it will almost certainly be rejected from the App Store. So taking your original question in the larger context, what you are asking to do is still not possible for an App-Store app.

If it's such a good idea, you should accept that the answer is "No" and move on to the question of whether to use a local notification or to not develop the idea further at all. If, at some point in the future, the ability to programmatically pull an app into the foreground becomes available, you can then add it to your existing app.
 
I read about this possibility, but unfortunately, I really want the application to switch on itself.

Thanks anyway for you answer Luke.

You need to think about why you think this is necessary. Only one app on an iPhone brings itself to the foreground automatically, and that is the phone app. Nothing else does, not even VOIP apps (they use a notification).
 
I understand your concerns, and agree with the basics.
But in my case the puprose is not to design an app store app. This is for private purpose, about which I want to deal with my foreground app and send it to background, or the opposite.
There's no way in my design that I should encounter problems such as interfering with third party apps.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.