UIApplicationExitsOnSuspend = false

Hi folks

With this enabled in your build.settings for facebook, ads etc.:

UIApplicationExitsOnSuspend = false

I was wondering is there a way to detect if the app was exited/closed normally through the home button being pressed and treat the next opening of the app like it hadn’t been opened before, so instead of going back to where it left off it loads the opening sequence again?

Think this may answer my own question!

http://mobile.tutsplus.com/tutorials/corona/corona-sdk-handling-application-suspension/

EDIT:Actually no it doesn’t because you only get suspend and resume no matter how you leave the app :( .

Hi there,

I’m not sure I understand exactly what you’re trying to do.  On iOS, how else would someone leave the app except by pressing the home button?  The only other ways I can think of would be (a) actions initiates by your app that take the user out of the app, like logging into facebook, opening a URL, etc., and (b) actions from outside the app that force the app to suspend, like receiving a phone call, activating Siri, etc.  For (a), you could set a flag before the action is taken so that, when the app resumes, you check the flag to tell whether the suspension was caused by your app or by the user.  That would distinguish (a) from (b).  But within (b), I don’t see a way to separate out the case where the user presses the home button from the other reasons the app might get suspended.

More importantly, though, I wonder why you’re trying to accomplish this?  Most users expect an app to simply resume where they left it.  They might be annoyed at having to view an opening sequence again (unless there’s some legitimate reason for it).

  • Andrew

Yes exactly, so if you log into facebook you leave the app and want to pick up where you left off.  But if the user presses home, they shut the app down, I wanted a way to go right back to the start if this was the case, decided to move on from that now as I don’t think you can.  I wanted it to be more like a PC game style loading where you watch the opening sequence each time you enter the app.

I’ll leave it to you to make the decisions about how you want your product to work, but I think your approach will be annoying to users.  What if they leave the app just for a second to check an email they just received?  They come back a few seconds later, expecting to continue where they left off, and instead they have to watch an opening sequence?  That doesn’t seem right.  I don’t know of any successful mobile game that does that.

  • Andrew

Hi Andrew, I agree so it’s not happening!!  :wink:

Ah cool, I misread your last post and didn’t realize you said you’re already moving on from it.  Good to hear.  :-)

  • Andrew

Think this may answer my own question!

http://mobile.tutsplus.com/tutorials/corona/corona-sdk-handling-application-suspension/

EDIT:Actually no it doesn’t because you only get suspend and resume no matter how you leave the app :( .

Hi there,

I’m not sure I understand exactly what you’re trying to do.  On iOS, how else would someone leave the app except by pressing the home button?  The only other ways I can think of would be (a) actions initiates by your app that take the user out of the app, like logging into facebook, opening a URL, etc., and (b) actions from outside the app that force the app to suspend, like receiving a phone call, activating Siri, etc.  For (a), you could set a flag before the action is taken so that, when the app resumes, you check the flag to tell whether the suspension was caused by your app or by the user.  That would distinguish (a) from (b).  But within (b), I don’t see a way to separate out the case where the user presses the home button from the other reasons the app might get suspended.

More importantly, though, I wonder why you’re trying to accomplish this?  Most users expect an app to simply resume where they left it.  They might be annoyed at having to view an opening sequence again (unless there’s some legitimate reason for it).

  • Andrew

Yes exactly, so if you log into facebook you leave the app and want to pick up where you left off.  But if the user presses home, they shut the app down, I wanted a way to go right back to the start if this was the case, decided to move on from that now as I don’t think you can.  I wanted it to be more like a PC game style loading where you watch the opening sequence each time you enter the app.

I’ll leave it to you to make the decisions about how you want your product to work, but I think your approach will be annoying to users.  What if they leave the app just for a second to check an email they just received?  They come back a few seconds later, expecting to continue where they left off, and instead they have to watch an opening sequence?  That doesn’t seem right.  I don’t know of any successful mobile game that does that.

  • Andrew

Hi Andrew, I agree so it’s not happening!!  :wink:

Ah cool, I misread your last post and didn’t realize you said you’re already moving on from it.  Good to hear.  :-)

  • Andrew