iOS: OnExit required for non-multitasking apps

Monkey Targets Forums/iOS/iOS: OnExit required for non-multitasking apps

DGuy(Posted 2011) [#1]
While the OnSuspend/OnResume notifications are appreciated, if an app is run on an iOS version or device that does not support multitasking, or the developer, via the apps info.plist, chooses not to support multitasking, when the user exits the app, OnSuspend is not invoked.

This is because when a non-multitasking app exits, the 'applicationWillResignActive' method (which OnSuspend is invoked via) is not called; instead the 'applicationDidEnterBackground' and/or 'applicationWillTerminate' methods are called.

The desired solution would be to have the 'applicationWillTerminate' method invoke an OnExit type event. Doing so would allow the app to save/clean-up the app state under all circumstances (ie. becoming temporally in-active, moving into the background or actually quitting).

I'm sure other targets, for similar reasons, would find an OnExit type event very useful!


marksibly(Posted 2011) [#2]
Hi,

Yeah, I'm vaguely planning on adding an OnDestroy to go with OnCreate for this, I just want to look a bit more carefully at what Android and WP7 do first.