How to Close a mobile app?

You must Login before you can answer or comment on any questions.

I've am in need of a button that completely closes the app. I've tried creating a window and setting exitOnClose:true and then calling a win.close() but it does't work... Anyone successfully done this? I need it to work on both Android and Iphone.

Thanks

2 Answers

Accepted Answer

Hi,

On iPhone you are not allowed to close the app other way then pushing the Home button on the device. It's an Apple rule.

Thanks Adriano... but it's not closing the app when they hit the home.... when you click on the icon again it puts you right were you stopped... I've tried exitOnClose on every window and tabgroup and nothing

— answered 2 years ago by Chris Whittle
answer permalink
1 Comment
  • If I understood right what you want is the app not to pause and then resume. What you want is to restart the app to open it, right?

    If so, iPhone do the following:

    1- From your ProjectFolder/build/iphone copy info.plist to ProjectFolder (the folder that has tiapp.xml file)

    2- In info.plist on root folder, add the key:

    <key>UIApplicationExitsOnSuspend</key>
    <true/>
    3- Delete all contents of the folder build/iphone

    4- Enjoy!

    — commented 2 years ago by Adriano Paladini

Your Answer

Think you can help? Login to answer this question!