NativeApplication.nativeApplication.exit() does not seem to work on iPad!
Using sdk 2.7, it works fine on Flash builder, but once deployed to an iDevice nothing happens, the app does not quit!.
I've already included the extra key in the iPhone InfoAdditions:
<key>UIApplicationExitsOnSuspend</key>
<string>YES</string>
Did that, still no dice. (found that tip here at DevGirls http://devgirl.org/2011/06/24/exit-vs-suspend-your-ios-application/)
This is on an iPad 2, running the latest iOS.
I did check the .ipa's Info.plist and the setting is there is a Boolean=Yes!
Using prior syntax the value showed up as String.
So the setting does make it into the ipa, but iOS simply ignores it!
Thanks anyway Sanika.
Hi,
@Julio
is your application frozen or in supsended state? If no - but you're facing "bad" state in your application you need to handle that state in such way that while supporting multitasking - your application is reset to "proper" state - as there is no support on iOS for programmatic termination (so native application cannot just terminate itself).
http://developer.apple.com/library/ios/#qa/qa1561/_index.html
hth,
regards,
Peter
Oh no, the application is not frozen or anything, it just does not close when I execute a "NativeApplication.nativeApplication.exit()", as it should and as the documentation says.
The application just keeps running!
I know that iOS apps do not quit in general, you just hit Home and fire up something else. But this is an internal enterprise kind of app, that taps into the corporate database and should not stay on and connected all the time. Users need to 'quit'...
Anyway, I believe we may have to adapt it to behave like any other app, sign off and stay on, and ready to sign back in again, much like skype, facebook,viber and others... maybe it is time to switch paradigms from you run-of-the-mill corporate database mentality :-(
cheers,
julio
Hi,
iOS does not provide a way to exit the application. So it is expected that nativeApplication.exit() won't work on iOS and it does on Android.
One question, how are you making sure that you application is not relaunching? The fact that you see it on double-tap Home does not mean that it did not exit. This is because double-tap Home in iOS 4 gives you a list of recently launched applications.
Hope that helps.
Thanks,
Sanika
aha! the setting did work.
the problem I was seeing is an iOS thing, because nativeApplication.exit() does not take you to Home automatically, as it does on Android.
but my app does quit when you hit Home, it does not go into suspended mode.
I modified my UI to identify when I'm starting from scratch, or coming back from suspended mode. Now I can clearly see that with that UIApplicationExitsOnSuspend=true, the app does close.
Definitely a new paradigm. Need to stop thinking about apps running on the desktop or browser.
Thanks you.
julio
julio
I've been playing with this same problem for ages - just found your post. and the link to devgirls.
What code have you put in to identify when starting from scratch? if I may ask please.
I am strongly suspecting that this latest ios4 on my iPhone is still not doing it properly?
although this discussion really cleared up a lot of mystery for me
thanks
Robert
Robert,
I don't know what you mean by 'starting from scratch', but I'll take a shot.
Just to make it clear, with the UIApplicationExitOnSuspend set to true, apps will always exit when you hit the Home button. Thus when you run your app again with will "start from scratch", if that is what you mean.
In my case I save some preferences/configuration data to a SharedObject. Upon startup, on my app's creationComplete event, I look for that SharedObject and if not available I can presume this to be the first run.
ON a first run I switch to the prefs/config view. (where user needs to set up the host address/IP and some other stuff).
Next time the SharedObject will be there and I know I can present my initial view, which in my case is a login view.
hth
julio
Julio,
Thanks. Excellent.
That’s exactly what I mean.
I have put in an option to [Reset] my app, that clears the SharedObjects, but of course with the thing in suspended state, it pretty much gets lost after that.
So, in theory, I should
Clear SharedObjects
Exit
Press home button ( to completely shut down the app)
I need to be able to allow users to log into a different login, other than one currently stored in SharedObject, so I needed to clear those, and do a reload as well as restart. Seems like a lot of footwork just to get the thing to … begin at the beginning..
Hmmm.
This is an interesting 'feature' for sure.
Thanks Julio.
Robert
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).