How to pause an app and resume where it left?

Hi all,
I am developing an app. Each time I leave the app, when I come back the app starts from the beginning.
I am using an iPhone4, so there is multitask.
I do not close the app (I don’t remove the app from the taskbar). I would like to have the app in the same exact position where I left it.
There are two different apps which show what I want:

  • Tilt Monster - if you leave the app, then all data is gone and you start from the splash screen
  • The Patriots UK - if you leave the app, when you come back, the app is in pause mode.
    How could I implement the pause mode, and have the app in pause when I leave and then I come back? [import]uid: 65219 topic_id: 15008 reply_id: 315008[/import]

you can implement this by using the system event listeners

http://developer.anscamobile.com/content/events-and-listeners#Xsystem
-finefin [import]uid: 70635 topic_id: 15008 reply_id: 55457[/import]

@lnjuanj,
you need to save the settings on exit and then when the app starts again, find if there was a state that was saved and load it and give the illusion to the user that it started from that point again.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15008 reply_id: 55460[/import]

@jayantv:
That is the method I had read that was possible to use (giving the illusion that the app was really paused).
However, when I see an app such as The Patriots UK, the app is resumed in no time, while the first time the app loads, it takes quite a while… So I think it is really paused! [import]uid: 65219 topic_id: 15008 reply_id: 55464[/import]

@lnjuanj,

Even of you use iPhone4 and it supports multitask, that doesn’t mean your app support multitask will unless you tell it to do so.

What you need is adding following parameter to your build.settings file.

UIApplicationExitsOnSuspend = false

Take a look at http://developer.anscamobile.com/content/configuring-projects#Build_Configuration:_build.settings

If you add this line Tilt Monster will also work as you wanted… [import]uid: 10478 topic_id: 15008 reply_id: 55467[/import]

Dear @PixelEnvision,
This is just what I was looking for!!!
Thanks so much!
Juanjo [import]uid: 65219 topic_id: 15008 reply_id: 55479[/import]

You are welcome :slight_smile: [import]uid: 10478 topic_id: 15008 reply_id: 55565[/import]